Jump to content


Photo

Downloading mp3s using headers is taking forever?


  • Please log in to reply
9 replies to this topic

#1 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 17 August 2006 - 06:51 PM

Hi

i'm trying to get a link that when clicked (not right clicked) will download a MP3 file.
I think i have it working, but when the file is downloading it takes forever then crashes.

Does this code look right to you.
$dir = '../cart/mp31/';	
$file = $dir.$_REQUEST['userfile_name1'];


header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
header('Content-length: '.filesize($file));
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".basename($file));

header( "Content-Description: File Transfer");

goto:
www.nickyrubin.com/members
username = paypal@solus-music.com
password = p4fnhtx9

thanks for anyhelp
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 17 August 2006 - 07:04 PM

You're not sending data? Where's the @readfile($file);?
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 17 August 2006 - 07:07 PM

OK,

that makes sence! i supose it would help.

Where do i place the code.
Is it at the end?
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#4 akrytus

akrytus
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 17 August 2006 - 07:09 PM

Are you aware that your username and password are being sent over the url.  Everyone can see them, and capture them.

Try just making a link to the actual file that simple.

<a href="..song.mp3">Song.mp3</a>

#5 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 17 August 2006 - 07:12 PM

Coool!

it work wounders.
thanks mate.

If i link to the mp3, wount  that only play the track? not download it.
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#6 akrytus

akrytus
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 17 August 2006 - 07:19 PM

It shouldnt play it, that would be streaming audio or something.  Never messed with that before.  Should download.

#7 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 17 August 2006 - 07:21 PM

Just tryed it, it  only plays the track. It dont download it.
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#8 akrytus

akrytus
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts

Posted 17 August 2006 - 07:22 PM

Huh, learned something new today!  Well now I know.


Also I had to login twice.  Does it do that for you?

#9 spires

spires
  • Members
  • PipPipPip
  • Advanced Member
  • 492 posts

Posted 17 August 2006 - 07:36 PM

Yeah,

I'm not to sure why yet.

I'm going try and now fix the Quantity problem, then look into that.

one problem after another.
How to make over $600 a day from AdSense? Discover EXACTLY how he does it in these videos:
http://www.adsense-online.com

#10 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 17 August 2006 - 09:16 PM

Just tryed it, it  only plays the track. It dont download it.

It downloads to the temp folder on your computer and plays it immediately with your default player. So technically you've "downloaded" it, just without the prompt. If you want to "force" download then use the php header method, and you need to print/echo the file to screen after the headers, so that user will get the data.
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users