I have no idea how to store uploaded files on my server. For example, should I always rename the uploaded file to a random string like 458783576487365934 and always store the files in the same folder? For example if I store pdf documents or images, do I put all the pdfs in the same folder (but with a random name so I can upload documents with same name)? If I do so, I would like that when the user goes to the url /files/458783576487365934
for instance, the downloaded file has its original name and not the real stored name but how?
I can store in DB the path and the original name but how to tell the browser its real name when we go to /files/458783576487365934
?
(I don't care about the actual process of uploading, I know about $_FILES and I use Symfony anyway)
header
function): header('Content-disposition: inline; filename="original_name.pdf"');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.