I didn't know you could do that with CFEXECUTE, that sounds like it will
work perfectly. I can simply use cfexecute to initiate the cf template
that generates the file... Very cool.

> I don't know what OS/platform you are using, but CFEXECUTE should do what
> you want.
>
> Recently I was working on this exact problem.  The application is a content
> management system for an advertising agency.  When Jobs are updated,
> sometimes HUGE files need to be moved, hundreds of megabytes in fact.  The
> best way I found to do this was to spawn a batch file with cfexecute, set
> the timeout to 0, which is a non-blocking mode of execution.  This means the
> process will run in the background and return control to the browser right
> away.
>
> The batch file can execute a ColdFusion template that will do the requested
> file manipulation, OR you can use your operation system's native file
> commands and then send the execution to a ColdFusion template to send the
> email confirmation.
>
> The possibilities are somewhat large if not endless.  What I've done is take
> this process and update a database field, effectively locking access to
> parts of the Job until file executions are done.  You can even create a
> queue for pending file operations in this way!
>
> Also, another trick you can do is to execute the cf templates from the batch
> file with the user's session id, namely cfid and cftoken.  In addition, if
> they have to log in, you can have a page where they can go to view the
> status of the file operations in progress, merely by reading a value from
> the database.
>
> You have to be careful because you can run into some problems when you get
> this granular.  An example would be a process that is spawned goes off into
> never-never land.  This is why there should be some kind of reporting for
> long running spawned processes.  There are many ways to accomplish that,
> though.
>
> Have fun!
>
> Andy
>
> > -----Original Message-----
> > From: Tony Schreiber [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, December 11, 2001 4:10 PM
> > To: CF-Talk
> > Subject: RE: Send response to browser, but continue working on request?
> >
> >
> > No, I want the browser to request a page that returns immediately (so the
> > broswer isn't waiting for a request to be completed and ultimately time
> > out), but "spawns" a long-running request that will create the requested
> > file and then email it to the user...
> >
> > I think the previously posted javascript/cfflush might work...
> >
> > > you are wanting the browser to make a request for a file but
> > not wait for
> > > the file to be retrieved? if so, I don't think that's feasible.
> > a general
> > > solution for the problem of generating the email would be to have a <img
> > > src="createfile.cfm"> that can send out the email and you can show them
> > > whatever message you'd like to show them and the browser
> > waiting for more
> > > should have no effect on the cfm or on the user.
> > >
> > > -----Original Message-----
> > > From: Tony Schreiber [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, December 11, 2001 9:33 AM
> > > To: CF-Talk
> > > Subject: Re: Send response to browser, but continue working on request?
> > >
> > >
> > > That let's me get a message to the browser, but the request is still
> > > running and the browser is still waiting...
> > >
> > > I want to browser to stop waiting...
> > >
> > > > Have you tried cfflush?  I believe this tag will allow you to
> > send partial
> > > > responses to the browser.  I might have spelled it wrong, but
> > I am sure
> > > > there is a function in CF.
> > > >
> > > > David
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Tony Schreiber" <[EMAIL PROTECTED]>
> > > > To: "CF-Talk" <[EMAIL PROTECTED]>
> > > > Sent: Tuesday, December 11, 2001 7:17 AM
> > > > Subject: Send response to browser, but continue working on request?
> > > >
> > > >
> > > > > I have a function that allows a user to create a file of available
> > > > > inventory. The problem is that it takes a long time and
> > eventually the
> > > > > browser will timeout, but they haven't gotten their file yet...
> > > > >
> > > > > What I want to do is let the user make the request and then
> > respond with
> > > > > "Thank you for your request. Your file will be created and
> > emailed to
> > > you
> > > > > shortly".
> > > > >
> > > > > How can I "spawn" off the part that will actually create
> > the file and
> > > > > still respond with a finished request to the browser?
> > > > >
> > > > >
> > > > > Tony Schreiber, Senior Partner                  Man and
> > Machine, Limited
> > > > > mailto:[EMAIL PROTECTED]
> > http://www.technocraft.com
> > > > >
> > > > > http://www.simplemessageboard.com ___Free Forum Software
> > for Cold Fusion
> > > > > http://www.is300.net ___________The Enthusiast's Home of
> > the Lexus IS300
> > > > > http://www.digitacamera.com ______________DigitA Camera
> > Scripts and Tips
> > > > > http://www.linklabexchange.com _____________Miata Link ECU
> > Data Exchange
> > > > >
> > > >
> > >
> > >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to