Some Web sites will not serve images and/or pages without an expected "referrer" HTTP header.
Are you trying to write a script to automatically download all images in a Web page?
Your guess is right. It is probably a CF8 issue. Your code works on Coldfusion 11. Have you installed all the updates and hotfixes for Coldfusion 8?
An alternative is
I actually found the problem and a solution, will post it at the bottom and mark it as the answer
I found the issue and solution. The problem was with the Java, the JVM had issues reading SOME PNG's from servers, but not all, there must be a newer way of encoding them that was not around when the version of java I had was created, or it's just a bug. I had an earlier version of 1.6 which is downloaded as version SE 6 from Oracle.
As per some instructions by Ben Forta I tried an update of the JVM to version 7 (1.7.x),
The update worked on my local dev machine which was CF8 with Win 7 64bit, and it actually fixed the CFIMAGE issue!
However, when I did the same update, with the same java file on the same version of CF8, CF would no longer restart throwing an error that it could not find a file.
Luckily I had a backup of the config file because I could not switch settings back any other way if CF would not start the administrator (Java also makes a .BAK anyway)
I tried the first build of version 7, same problem, so I went to the very last version 6, build 45, it installed, and it also fixed the CFIMAGE crash!
A couple of points for anybody else trying this
Make sure you have a back up the config, in CF8 it's located here (different to the location in Bens instructions)
Also note that the forward and backward slashes are different for the built in JVM that ships with CF and is set in the administrator, and the location you will specify
Original location: C:/ColdFusion8/runtime/jre
New location: C:\Program Files\Java\jre7\
Here is the location to the Java file (
Java SE Runtime Environment 6u45)
Took me days to get to the bottom of this, but the fix actually takes just a few simple steps and a few minutes, of course
Thanks for sharing this result with us. Could you mark it as correct? Cheers.
Whoops, I meant to do that... Done