I have an upload script that tests if there is already a file of the same name as the one being uploaded in the upolads directory.
If there is one, the user is asked if the file should be overwritten, or if the action should be cancelled. The form has a hidden field with the tmp_name.
Problem is, assuming they want to continue with the upload, the temp file is already gone! So I can't make the second script copy the file.
I know that I could make it so that my first script copies the tmp file to my own 'fake' tmp directory, and I can delete it later - but that is a lot of messing about.
I am sure that I read somewhere that PHP automatically unlinks files in the tmp directory after it runs each script, is there any way to prevent tmp files from being unlinked at the end of this one script?
I hope that I made sense...