You could use a do while file not exists loop to wait till the file gets written.
Regards Russ Michaels On Nov 13, 2012 5:26 PM, "Christophe Maso" <[email protected]> wrote: > > Hi I have a function that gets some binary data, uses that data to do a > cffile action=write, and then returns the file's path as a string. I'm > experiencing a problem that suggests the function is doing the return > before the write action has completed. In the code below, will the function > wait for the write action to complete before it sends the return? I'm > almost certain it will not; is there a way to force the function to wait > for the write to complete before it returns strWPTempFilePath, such as > cftransaction or something along those lines? > > <cfset strWPTempFilePath = > request.stcApplicationData.strTempImageDirectory & createUuid() & ".pdf"> > <cffile action="WRITE" file="#strWPTempFilePath#" output="#r_docBinData#" > addNewLine="no" /> > <cfreturn strWPTempFilePath> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353142 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

