Embedded image
A client recently decided to start storing all of their images in a database and usually we would point the image source to a cfm page, where we'd do something like this:
PLAIN TEXT
CODE:
request.uploadedPic = application.staffManager.getStaffImage(session.user.getId());
context = getPageContext();
context.setFlushOutput(false);
response = context.getResponse().getResponse();
out = response.getOutputStream();
response.setContentType("image/jpeg");
response.setContentLength(arrayLen(request.uploadedPic['staffPhoto'][1]));
out.write(request.uploadedPic['staffPhoto'][1]);
out.flush();
response.reset();
out.close();
Which worked nicely until I read about some performance issues with http calls and [...]
“We have a policy that we are not being hacked.”
Probably an old hat for most, but I just stumbled across this post from Kottke. Classic!
Back!!
After nearly three weeks of downtime, the site is back up. The move from my own little blogging tool to WordPress has been relatively painless... There was a small performance issue with 2.1 (which was rather drastic on my 64 meg VM), but the latest patch to 2.1.2 seems to have addressed this, as well [...]
Beyond SQL injection attacks
Courtesy of Slashdot a reminder that you should also worry about other types of injection attacks. Don't you just wish that everybody would play nice?
UPDATE
In a similar vein, Nadav Samet covers off in more detail Cross Site Scripting attacks, how they work and what you can do to protect your site.
LogParser
Charlie Arehart has a handy little article published in this months CFDJ on using Microsoft's Log Parser tool, which allows you to write SQL like statements against your CFMX log files. Couldn't find a publicly accessible link, but if you keep an eye on his articles page, I am sure he'll update it as soon [...]
Swapping out Batik
A while back I was tinkering with converting SVG output to PNG using Batik, but I was not having much luck with it as it seemed that the Batik jar files that come with CFMX were out of date or plain missing some methods. I gave up, but a colleague of mine, Zac, picked up [...]
Comments are broken
Apologies, my comments are broken. When I get a moment I'll fix them, though I wouldn't hold my breath right now.
If there's anything you'd like to add about any of my posts, drop me a note by e-mail (link is in the footer) and I'll update the post.
Refreshing web service stubs
I have been spending a few days building a bunch of web services for a client, however whenever I made a change to the web service itself the only way I could get that change to be reflected was by either waiting or re-starting cfmx. I did remember a post a while back that showed [...]
CFMX and the PowerBookPro
A wee while back the Mac PowerBookPros received a JVM update. This brings it up to version 1.5.06, which is fabulous, but of course stops you from being able to run ColdFusion. Thankfully the JVM upgrade leaves the old versions on your system. The simple trick to get your CFMX installation to wok again [...]
encodeURIComponent()
I just stumbled across this post from the Red Balloon guys, which reminded me that I wanted to blog about this great little resource about the subtle differences of URL encoding and JavaScript.
The bottom line of this article is that 9 times out of 10 you'll want to be using encodeURIComponent() to encode vars that [...]