• 0

[PHP] file reading


Question

ok so i had an idea to make a simple script to read a file (media file) into the buffer and send the proper audio/mpeg headers for the mp3 stream to the browser to play in the default media player within the browser (granted, obviously, that they have the proper extension/control installed to play embedded media).

the problem is that (by nature), the function invokes a file download prompt.

so my question is: is there anyway to force the browser to handle the file (in this case, in the media player) rather than prompt for download? like the opposite of the force-download header that is typically used to force a readfile stream to be downloaded instead of the contents displayed?

i know there are much easier ways of playing a file in the browser using html techniques but it wont work for this case, as i'd like to keep the source directories and files all named by their hashes in a private location and instead have that file piped to the browser for playback instead of download so someone cant just come along and pick up all the mp3s in the directory.

thanks for any suggestions

EDIT:

nevermind.. i figured it out.. sorry about this thread..

i just made a page that embeds the script file as the src which reads the file so that it pipes to the embed tag instead of prompting to download

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.