I need to let users pick a CSV or XLS file from their filesystem and press Submit and have PHP open it, look at it, decide if it is valid and then put the data in MySQL.
I am stuck on how the server gets the file they pick from their desktop?
Do I have to upload the file they pick to a temp directory?
Can I just take a copy and check it in memory?
Advice would be appreciated!
Read Handling File Uploads in the PHP documents. That will cover how to get it to the server. You do upload the file using a POST to a temporary directory on the server (handled fairly seamlessly for you) and then you just take the filename that it gives you and open that file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With