How to Download a file in browser - PHP

i made a script in php that downloades files (Audio/Video) to my server. Now i want to download to the user Computer … How is that possible??

Normally, you’d present the list of files for the user to download, and when they selected them I believe there’s a different header value you can output to have the browser offer to save the file rather than just open it.

Any piece of code you have?

I haven’t anything as it’s not something I’ve needed to do. Do you intend to present a list of files based on the directory they’re stored in, or are the names stored in a database table?

For the former: iterate through the directory and list the files that meet your selection criteria, for now surround them with html <a> tags as links for the user to download.

For the latter: same, but iterate through the results of a query to get the names out of your database table.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.