Jump to content

Loading an MP3 file through php validation for streaming in flash


amites

Recommended Posts

has anyone here done this?

 

I have setup a program to validate that a user has access to a given mp3 file, from there they have the options of downloading it or listening to it through a flash player.

 

The download part works well using:

<?php
header("Cache-Control: public, must-revalidate");
header("Pragma: hack"); // WTF? oh well, it works...
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($file_path)) );
header('Content-Disposition: attachment; filename="'.$file_name.'"');
header("Content-Transfer-Encoding: binary\n");

readfile($file_path);

?>

 

however I have had one hell of a time getting it to load into a mp3 player, I figure it has something to do with the "Content-Transfer-Encoding" though I'm honestly in a bit over my head at this point.

 

any thoughts / advice / help / examples / etc...

 

thank you

Link to comment
Share on other sites

not certain that "streaming" is the right word,

 

I am trying to use a flash player that is designed to access mp3 files through a common directory, given that these files are restricted I want to verify access before playing...

 

guess I'll keep tinkering

Link to comment
Share on other sites

  • 1 month later...

not certain that "streaming" is the right word,

 

I am trying to use a flash player that is designed to access mp3 files through a common directory, given that these files are restricted I want to verify access before playing...

 

guess I'll keep tinkering

 

Ok, well that is certainly doable, but you will need to create your flash application and handle all the security stuff in there.  As this is no longer a PHP question per se, I'd have to recommend you look into some actionscript. 

Link to comment
Share on other sites

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.