I ran into an issue today while trying to resize an image with CFIMAGE that was just uploaded with CFFILE. Apparently there are (were) a number of bugs when these two tags are used in succession. In my case, the image would be uploaded fine, and then magically be deleted by the CFIMAGE tag, at which point an error would be thrown because the file could not be found.
Code:
<!--- upload image ---> <cffile action="upload" destination="#expandpath("/images/sales/")#" filefield="image" nameconflict="makeunique"> <!--- resize it ---> <cfimage action="resize" width="640" height="480" source="#expandpath("/images/sales/#file.serverfile#")#" destination="#expandpath("/images/sales/#file.serverfile#")#" overwrite="yes">
Turns out there is a simple (hot)fix for this: http://kb2.adobe.com/cps/403/kb403411.html
Related posts:
Tags: ColdFusion









I would caution you against doing a straight resize after upload unless you are going to have a very low number of concurrent users or you have an incredibly beefed up dedicated server.
I was doing this in a CF8 app that had close to 2000 users and every time they all decided to upload at the same time we took down the shared server we where hosted on. I had some unhappy server admins on my hands… I am working on a queueing system to help alleviate the load issue that cfimage presents but for now… I have it disabled after upload.
Great tag but the performance leaves a lot to be desired.
Interesting. The app this code comes from is small with about two dozen users. I usually just CFEXECUTE ImageMagick’s “convert”, but was not able to force width/height constraints. I wonder how the performance of that vs. CFIMAGE compares…
You might want to take a look at using ColdFusion’s in-built DirectoryWatcherGateway for handling image resizing as you can do it independantly of the user’s request, so you won’t be potentailly trying to resize 100 images at the same time. More information here:
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-77f7.html
HTH
Thanks for this post. I spend all morning tracking down my code only to find out it’s a CF bug. Just installed the patch and now my code works fine.