Download uploaded files in folder

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

Download uploaded files in folder

Post by jauson »

How to view/read/or download the uploaded file in php.

I made a form and i create a folder for the uploaded file. I tested the form and yes all the file i uploading will directly go to /folder for uploaded files.

my only problem is, how can i view or download the file from /folder for uploaded files?

Help appreciated.
thanks a lot.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Download uploaded files in folder

Post by Christopher »

User glob() or other filesystem functions to get a list of the file and then build a web page with links to those files. If the uploaded files are in the pubic directory then they can just be URLs. If the files are outside the public directory then create a script that sets the correct header and sends the file to the browser.
(#10850)
Post Reply