Jump to content

Download file outside of web root via hyperlink


MileHighLife

Recommended Posts

You will have to fopen() the file and write the file content on the page, but before this you will have to send proper header that will denote the mime type of the file that you are writing on your page.

 

They are .wav files. So I'm assuming I'd send a header like:

 

header('Content-type: audio/x-wav);

 

Then proceed with fopen()?

header("Content-type: audio/x-wav");
header("Content-Disposition: attachment; filename=filename.wav");
readfile("/path/to/file/thisone.wav");

 

something along those lines i guess

 

AhhhH!!!!!

 

Fabulous! You all rock. It works perfectly. Thanks.

 

Jeff

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.