Krzysztof Lenda
Krzysztof Lenda

Reputation: 398

uploading files - how to store file in non public folder

I have problem with uploading files. I followed these instructions: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html and everything is working fine, but I want to save uploaded files in a folder that is not public and with random name and then send it to the browser in original name. I know how to put file in non public folder with random name and how to save original name to database, but what should I do next for getting this file content and send it to browser with original name? How to achieve that?

Upvotes: 2

Views: 1649

Answers (1)

meze
meze

Reputation: 15087

Store the hidden path in the database, then just read it in your php script that is public available and send your file to a user, if you don't how to send files in php, you can find it out here on stackoverflow.

Upvotes: 3

Related Questions