Unset uploaded files in PHP

cliftongreen

New Member
I have a Form that I am using to receive an uploaded .csv file, parse it and insert the data into my MySQL db on an Apache server. The page first checks to see if there is an uploaded file. If there is, it processes the data, if not the form (below) is displayed.\[code\]<form enctype="multipart/form-data" action="uploadfaculty.php" method="POST" id="UploadForm">Choose a file to upload: <input name="uploadedfile" type="file" /><br /><input type="submit" value="http://stackoverflow.com/questions/3671498/Upload File" /></form>\[/code\]My problem is that currently the user can simply F5 the browser over and over again and because the file is still on the server and in the $_FILES array, it processes it every time.I've tried:
\[code\]unlink($_FILES['uploadedfile']['tmp_name'])\[/code\], \[code\]unlink($_FILES['uploadedfile'])\[/code\], \[code\]unset($_FILES['uploadedfile']['tmp_name'])\[/code\], and\[code\]unset($_FILES['uploadedfile'])`\[/code\]I've even reset the form via Javascript (which I knew would not work, but did it just to eliminate all doubt). All to no avail. I'm sure it's something simple I'm missing...it almost always is. Any thoughts?
 
Back
Top