I am working on a csv import option on my php page. Is there any way to allow the user to upload a csv for processing and then destroy the file when it is complete? I have seen plenty of tutorials for uploading files, but none seem to mention something like this.
Share
When you upload a file to PHP it’s stored in a temporary location, you can move it from there to a working directory, do your processing and then remove it.
All you have to do is
unlink()it when you’ve finished processing to delete it.For more information on uploading files see:
http://php.net/manual/en/function.move-uploaded-file.php
http://www.w3schools.com/PHP/php_file_upload.asp