Coldfusion CFHTTP UTF-8 Problem with Non-ASCII characters when receiving application/json responses
It cost me quite some time to figure this out.
Consider this scenario: You are using CFHTTP to request some JSON data from an external API. The data is sent UTF-8 encoded and everything is fine as long as the API uses Content-Type: text/html. Now if the Content-Type changes to application/json everything will break and the characters get messed up. Now what if you can’t tell the external API to
Client-Side File Upload to Amazon S3 with NodeJS backend
This article describes the upload of a file to Amazon S3 purely on the client. This means the server (NodeJS) in this case never gets to see / has to handle the actual file the user is uploading.
To upload files from within NodeJS the npm (Npm) module Knox can be used.
Node.js 0.4.9 or higher is required as a runtime environment for our example.
The following principle applies to the applicatio
Read more…Install wkhtmltopdf static binary on Ubuntu Server
Running wkhtmltopdf and wkhtmltoimage to create PDF files from HTML files on a Mac is easy and simple. When you need to install it on a non-mac production server a little bit of work is involved.
The Problem: Installing it simply via sudo apt-get install wkhtmltopdf on Ubuntu will install a reduced functionality version which is probably not what you want. According to the manual the reduced func
How to convert a Coldfusion SQL query to a Javascript object
Working with SQL databases is easy and straightforward in Coldfusion.
Looping and creating HTML output from queries is easy too.
When you want to work with SQL query data in Javascript it starts to get a little bit nasty. Coldfusion is able to turn a query into a JSON representation. So reading the data in Javascript works but it’s not easy to loop over the data. I want to show you how we turn
Read more…Google Maps: Unspecified error in main.js Line: 33
Just a quick hint for those getting this Javascript error with IE9, IE8, IE7 etc. and Google Maps.
You are probably used to the standard jQuery way to wait till the page / DOM is ready.
$(function() {
// Your Google Maps code here
});
This is not good enough for IE and Google Maps and you will get this:

The following solved it for me:
$(window).load(function() {
// Your GoogleAmazon CloudFront Invalidation with Coldfusion
Amazon’s CloudFront is great to reduce load on local servers if you are serving a lot of static files or files that can have a long cache timer set.
Sometimes you need to remove files from the CloudFront caches and this is where the Invalidation feature comes in.
An invalidation batch-request invalidates one or more files (paths) from all CloudFront edge location.
Currently it will take about
Read more…Using the Bcrypt hash algorithm in MS-SQL Server
Storing the passwords in plain text within a database is not a good idea. Many people use the same password for their email, online-banking or social network accounts and probably your app. So the passwords should be safe if your database gets into the wrong hands.
So how do you safely store a password?
Use BCrypt.
One way could be to use a library for PHP, Java, Ruby, Python and so on and stor
Read more…Adobe, please fix Coldfusion SerializeJSON()
Coldfusion 9.0.1 is essentially disqualified to be used with NoSQL datastores where JSON is involved.
We have used Coldfusion since 3.0 in 1998 upgrading to 4.0, 5.0, 6.1, 7.0, 8.0 and 9.0. We did this upgrade for our servers and for even more of our customers servers that use our software.
So i am kind of an Coldfusion evangelist with one difference being that i don’t get paid by Adobe but i
Read more…