Skip to main content
Participant
January 10, 2010
Question

how can i check if a cfimage resize image file is available for display?

  • January 10, 2010
  • 1 reply
  • 1217 views

I have a coldfusion upload script that is called from a flex application. It deals with large image files (5mb +) and resizes them into 3 smaller sizes for different uses in the flex application.

The upload script containing the resize commands finishes executing and returns a successful result to the flex application, but when the application tries to load the resized images they are not available at that time. They also do not show up on a file system browser until about 20 seconds after the upload script has finished (after which the application displays them correctly as well).

Is there a way to stop an upload script returning until the resized file has been written to the filesystem and thus available to the calling flex application?

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
January 14, 2010

You can do it using cflock or cfthread. What is your Coldfusion version?

Participant
January 14, 2010

Currently running Coldfusion version 8.0.1. Standard Edition

BKBK
Community Expert
Community Expert
January 15, 2010
Is there a way to stop an upload script returning until the resized file has been written to the filesystem and thus available to the calling flex application?

In Coldfusion 8, you can make execution wait for some time. Just add the following line before the return code:

<!--- wait 20 seconds --->
<cfthread action="sleep" duration="20000" />