0

Possible Duplicate:
Forcing to download a file using PHP
How to start file download instantly using php headers

We're working on a converter site, and we want users to download the converted file. How to make the files downloadable? The other problem is the audio files are playing on browsers, but we want all Video and audio file downloadable. Php code.

Community
  • 1
  • 1
yuri04
  • 25
  • 4

1 Answers1

2

Using the Content-disposition header should do it:

header("Content-disposition: attachment; filename=some_file.ext");

Also including a Content-type header is good practice as well (especially if you are using a php page to serve it):

header("Content-type: mime/type");

e.x. audio/mpeg (mp3), video/mp4

Grexis
  • 1,502
  • 12
  • 15