Search code examples
jqueryuploadify

How to upload files to temporary directory and delete the file if submit button is not clicked?


I have a form that I want to use uploadify on. I have set the uploadify to upload the files on auto when the file is selected. I want to do something like, upload the file to a temporary directory such that the filename of the file is saved in the hidden file, and when the user clicks submit, the file is moved to the upload directory. but if the user exits the page or don't click submit, the temporary file should be deleted on the fly. I am new to uploadify. Seeking some help.

Additional Information: I have seen a demo of http://dondedeportes.es/uploader-previewer/ . I also wanna know, how it cleans the temporary directory on page exit.


Solution

  • You may have to upload the file upon selection to your temp directory. Then if they submit, it also goes to your target directory. Then just run a job (cron maybe) to clean up the temp directory. This may be the easiest way to solve this.