Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / April 2006



Tip: Looking for answers? Try searching our database.

File Creation

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vbprog40 - 29 Apr 2006 00:19 GMT
I am creating a PDF file with CFHTTP (a third party tool is creating it) I need
to know when the file which is located in the same folder is done creating.
Normally it doesn't take but 3-4 seconds and then I use CFLOCATION is direct
the user to the PDF file. Sometimes though it directs them before it is created
fully.

Is there a way to tell when its created fully to then direct them with
cflocation?

Thanks!
Mr Black - 29 Apr 2006 01:34 GMT
Hard to recommend for sure, but, in theory, FileExists() should fail until
another app finish its work and close the file.
So, you can loop and wait until "file exists".  You also could try CFFILE
Action="read", if FileExists() doesn't help.
BKBK - 29 Apr 2006 10:28 GMT
You could use locks, thus

<!--- for PDF documents at application level, with access to all users --->
<cflock name="pdfLock" timeout="6" type="EXCLUSIVE">
<!--- ...creating a PDF file with CFHTTP (a third party tool is creating it) I
need to know when the file which is located in the same folder is done
creating. Normally it doesn't take but 3-4 seconds --->
</cflock>
<cflock name="pdfLock" timeout="2" type="READONLY">
<!--- use CFLOCATION is direct the user to the PDF file  --->
</cflock>

<!--- for PDF documents at session level, with access to the current user--->
<cflock scope="session" timeout="6" type="EXCLUSIVE">
<!--- ...creating a PDF file with CFHTTP (a third party tool is creating it) I
need to know when the file which is located in the same folder is done
creating. Normally it doesn't take but 3-4 seconds --->
</cflock>
<cflock scope="session" timeout="2" type="READONLY">
<!--- use CFLOCATION is direct the user to the PDF file  --->
</cflock>
Neo Rye - 29 Apr 2006 17:16 GMT
I wasn't looking for an alphabetical list, just trying to get to the inner most
nested struct the quickest.  In you example, how would I get the value of
employee.phone.office.ext  without previousley knowing that phone.office.ext
existed and I only know about employee. I could iterate over it with some type
of iterator hasNext(), but was wondering if there was a quicker way.

<cfset employee.name.first = "Mary">
<cfset employee.name.last = "Smith">   
<cfset employee.position = "Boss">
<cfset employee.phone.home = "111-2222-33333">
<cfset employee.phone.office.ext = "444">
<cfset employee.phone.office.number>
BKBK - 29 Apr 2006 17:37 GMT
Oh, so you require the value of the "deepest" key(s) in the structure.  The
only method I know of is indeed to iterate across the keys/substructures,
perhaps posing a question with isStruct() at every stage.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.