Let's say a user is starting to upload a file to the server via FileReference. What happens to that temporary file if the user cancels the upload or closes the browser? At what point is the server script called? Is the server script (in my case, ColdFusion) called only once the file has been successfully put on the server?
I'm trying to determine if I need to remove any temporary files or if FileReference is smart enough not to execute my server-side sc开发者_如何转开发ript before the file is done uploading to the server.
The serverside script is called as soon as the user clicks on the upload button. From then on, your serverside script communicates to the server's file system through the webserver (apache,...). Usually, until the transfer is finished, the transfered data is buffered into a temporary file stored in a specifically dedicated folder. When the transfer is finished (as indicated by the http data sent by the user's browser), the file is accessible to your serverside script for further processing. If the transfer is interrupted, the server has a kind of garbage collection process that eliminates uncompleted files to keep the system clean and lean.
This is a general description of the upload process : it will vary according to the specific technologies of the hosting system.
精彩评论