Jump to content

Recommended Posts

Do you have proper permission on the directory where you are trying to use fopen() to read file data?

 

I do and am able to read and display the filenames on a page. I just can't figure out a way for users to download the files.

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.