I am trying to upload a doc file from a form and send it to email. I am using
$_FILES['file']['tmp_name'];
The problem is, it is returning a randomly generated file name. So, when it reaches the inbox, the filename is phpvwRGKN.dat (filename is random each time).
How can I preserve the filename and extension?
Note: I am using geekMail class
$_FILES['file']['tmp_name'];
will contain the temporary file name of the file on the server. This is just a placeholder on your server until you process the file
$_FILES['file']['name'];
contains the original name of the uploaded file from the user's computer.
$_FILES["file"]["name"] - the name of the uploaded file
from http://www.w3schools.com/php/php_file_upload.asp
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