This content has been marked as final. Show 2 replies
CF is processed, sequentially, from top to bottom of the template. Each
preceeding instruction must complete before the next one is processed.
The only way you could see what you're seeing is if this magicktag.cfm file
spawns some non-CF process to do the image processing, and that process
runs asynchronously with CF. It's probably worth checking the docs of it
to see if this is the case, and - if so - whether it ever returns anything
or sets anything detectable to CF that it's finished. And then get CF to
wait for THAT, rather than looping to some random number (which will eat
your CPU whilst it runs, and - if anything - will make your problem WORSE).
If there's not "completion flag", you should probably wait until the file
you're trying to FTP actually exists before trying to FTP it.
If you need to wait an arbitrary period of time, use the sleep() method of
java.lang.Thread, which is more accurate and far less CPU intensive than
just making CF loop for n iterations, in the hope that on the machine
you're running it on, n iterations equates takes longer ot execute than the
process you're waiting for (which will be slowed up by the loop...).
Thanks for your reply, it certainly makes sense. I have modified the code to include a cfdirectory list to check that the file exists, and also have added a "hold" folder for the first upload to go to. Then the cf_magik will grab from there, resize and put the new & thumb in their respective folders - This way an unresized image cannot be FTP'd because the checker will not find the original in that folder. I am still using a cfloop, but only as a means to cycle trhu checking the dir for the file: