AES Encrypt in CryptoJS and decrypt in Coldfusion

There seem to be two issues: CryptoJS is not using your variable as the key. As @Miguel-F mentioned, when you pass in a string, “it’s treated as a passphrase and used to derive [the] actual key and IV”. Both are randomly generated, which is why your encrypted result keeps changing. But more importantly, this means … Read more

Dynamic Variable Naming and Reference (ColdFusion)

One Option: Setting a dynamic variable name: <cfset variables[“GC” & AID] = “Testing” /> Output the value of the dynamic variable name: <cfoutput>#variables[“GC” & AID]#</cfoutput> Another Option: Setting a dynamic variable name: <cfset variables[“GC#AID#”] = “Testing” /> Output the value of the dynamic variable name: <cfoutput>#variables[“GC#AID#”]#</cfoutput>

ColdFusion Parameterizing a Query

I don’t get any CFErrors on the screen but my CFChart is blank. Ignoring the correct approach for a moment, the reason that happens is that you are using the incorrect cfsqltype for the parameters. So you are actually sending different values to the database (and consequently performing a different comparison) than you are thinking. … Read more

ColdFusion adding extra quotes when constructing database queries in strings

ColdFusion, by design, escapes single quotes when interpolating variables within <cfquery> tags. To do what you want, you need to use the PreserveSingleQuotes() function. <cfquery …>#PreserveSingleQuotes(query)#</cfquery> This doesn’t address, however, the danger of SQL injection to which you are exposing yourself. Using <cfqueryparam> also allows your database to cache the query, which in most cases … Read more

ColdFusion https connection failure

If you are using cfhttp to connect via SSL (https) then the ColdFusion server definitely needs the certificate installed to successfully connect. Here is a previous answer that I gave on a similar issue: Here are the steps you need to perform in order to install the certificate to the Java keystore for ColdFusion. First, … Read more

How to suppress the file corrupt warning at Excel download?

If you don’t want to look for a solution, but just want to solve the problem, insert this key in your registry to suppress the notification: [HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security] “ExtensionHardening”=dword:00000000 You can accomplish the above by doing the following: Open your Registry (Start -> Run -> regedit.exe) Navigate to HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\OFFICE\12.0\EXCEL\SECURITY Right click in the right window and … Read more

$.ajax context option

All the context does is it sets the value of this in the callbacks. So if you’re in an event handler, and you want this in the callbacks to be the element that received the event, you’d do: context:this, success:function() { // “this” is whatever the value was where this ajax call was made } … Read more