I’m uploading a file to a server then I store the original file name in a database.
Now for downloading I am currently using something like this:
Content-Disposition: attachment; filename=<?=urlencode($file)?>
It works but it replaces space characters with +
How can I restore the original filename when downloading?
The
urlencodefunction is putting the+signs in your filename string – if you dont want the+signs remove theurlencode– then put the string in quotes :