When a user uploads a file, it first gets uploaded to a folder on my local server, and then gets moved to an amazon s3 server for storage. Currently, when the file is moved to s3, the local file gets deleted.
What I would like to do:
Rather than delete the local file, I would like to replace the local file with a 0-byte file. Reason: so that if another user uploads a file with the same name, the system will know it needs to rename the second file.
How can I replace a file ("myvideo.flv") with an empty file of the same name, so that "myvideo.flv" now contains 0 bytes?