I have a form(HTML, PHP) that lets the end user upload a file to update the database(MySQL) with the records in the uploaded file(specifically .csv). However, in the phpscri
I wrote like this:
$filePath = realpath($_FILES["file"]["tmp_name"]);
This gave me the full path to the uploaded file in PHP. If you find 0 bytes problem in file download, just modify this content-lenght line like this
header("Content-Length: ".filesize($filePath));
Where $filePath should be absolute path to file not just file handle.