nohandlesleft254
IS-IT--Management
Hi,
Im using the below code to write then check a txt file. The problem being it always returns false. I thought this may be the delay in writing the file so i added a loop from 1 to 50000 before checking but it still returned false. Do i need to wait longer? Also is there a better way of delaying the check?
Thanks
<!--- Write the text file --->
<cffile action="Write" file="#Application.ImportDir##FileName#.txt" charset="ASCII" output="#Body#">
<!--- Check the file was written --->
<cfloop index="i" from="1" to="50000">
</cfloop>
<cfset FileLocation = Application.ImportDir & FileName & '.txt'>
<cfif FileExists(FileLocation)>
<cfset FileSaved eq "True">
</cfif>
Im using the below code to write then check a txt file. The problem being it always returns false. I thought this may be the delay in writing the file so i added a loop from 1 to 50000 before checking but it still returned false. Do i need to wait longer? Also is there a better way of delaying the check?
Thanks
<!--- Write the text file --->
<cffile action="Write" file="#Application.ImportDir##FileName#.txt" charset="ASCII" output="#Body#">
<!--- Check the file was written --->
<cfloop index="i" from="1" to="50000">
</cfloop>
<cfset FileLocation = Application.ImportDir & FileName & '.txt'>
<cfif FileExists(FileLocation)>
<cfset FileSaved eq "True">
</cfif>