Question
Code before CF writes client file to disk
Can I write some CF code and <cfflush> it out
before CF tries to process form values or at least before it
tries to write a client file to disk?
Here is the situation:
A form has a file input element so that the client can upload a file. Sometimes it takes a while (several seconds) to upload the file. The majority of the time is waiting for CF to write the file to a temp directory. I'd like to write some CF code that will execute before CF tries to process the form values and puts them into the form scope -- or at a minimum, before it tries to write the client file to disk in the tmp directory. The output I'd like to produce would be an animated gif and some text. Here's an example of the flow I would like to have:
* Form is submitted by client
* *** special *** generate some output and flush it out to the client (maybe via an "undocumented" file, 'preFormProcess.cfm' -- similar to 'application.cfm'. This must occur before CF tries to put the form values into the form scope, or at least before it tries to write the file to disk in the tmp directory.
* Then, have CF do it's normal thing, process the form fields, stream the file to the tmp directory
* execute the normal cf code
I can do this in C/C++ because I can determine when I read the form data that was posted (via standard input), but I don't see any way to do this in ColdFusion, because it automatically processes all the form values, and automatically writes any uploaded files to disk, before I can have any of my code execute.
Please let me know if there is any way to sneak in my code before CF automatically processes the form data.
Thanks!
Here is the situation:
A form has a file input element so that the client can upload a file. Sometimes it takes a while (several seconds) to upload the file. The majority of the time is waiting for CF to write the file to a temp directory. I'd like to write some CF code that will execute before CF tries to process the form values and puts them into the form scope -- or at a minimum, before it tries to write the client file to disk in the tmp directory. The output I'd like to produce would be an animated gif and some text. Here's an example of the flow I would like to have:
* Form is submitted by client
* *** special *** generate some output and flush it out to the client (maybe via an "undocumented" file, 'preFormProcess.cfm' -- similar to 'application.cfm'. This must occur before CF tries to put the form values into the form scope, or at least before it tries to write the file to disk in the tmp directory.
* Then, have CF do it's normal thing, process the form fields, stream the file to the tmp directory
* execute the normal cf code
I can do this in C/C++ because I can determine when I read the form data that was posted (via standard input), but I don't see any way to do this in ColdFusion, because it automatically processes all the form values, and automatically writes any uploaded files to disk, before I can have any of my code execute.
Please let me know if there is any way to sneak in my code before CF automatically processes the form data.
Thanks!