Disabling stream?
Posted by: spacerock88 (---.dsl.skt2ca.pacbell.net)
Date: December 03, 2009 11:27AM

Im having a bit of an issue and was wondering if anyone knew how to fix it. I have a file that is a mp3 file that is streaming when linked however I want to totally disable streaming of any sorts for all media based files and force the user to download the file this goes for mp3, mpeg, txt and so on.

Any help on the matter would be great. smiling smiley Thanks ahead of time.

Options: ReplyQuote
Re: Disabling stream?
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 03, 2009 03:43PM


Options: ReplyQuote
Re: Disabling stream?
Posted by: spacerock88 (---.dsl.skt2ca.pacbell.net)
Date: December 03, 2009 08:13PM

I know its a php setting server side I dont want to use a header because of the type of setup im using.

Options: ReplyQuote
Re: Disabling stream?
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 03, 2009 08:16PM

its not a setting, it has to be sent as a header.. or else the user has to right click the file and "save target as"

that is why so so many websites use "save target as" cause no other way apart from these two is 100% reliable

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Disabling stream?
Posted by: spacerock88 (---.dsl.skt2ca.pacbell.net)
Date: December 03, 2009 10:37PM

Well the issue im having is its not a website I just have folders inside the www folder and the user just browses from folder to folder to file there is no website loading other then the default tempelate standard servers use so how would I go about making this work without having to make a page for each file or something.

What im trying to do in sort is im hosting the web server from home and connecting to it via mobile phone so I can download my files directly to my phone without having to be at home. However I dont know if the phone is trying to stream it or if the timeout is just to high but it takes it nearly 2 min just for the phone to start the download request so I am trying to find some sort of fix and my friend that runs a hosting company for a living said he though it was a php setting that controlled it hints my asking so what do you recommend I do?

Options: ReplyQuote
Re: Disabling stream?
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 03, 2009 11:06PM

i recommend making one php page.. that will loop thru the folder and liast all the file on the page...

when u select 1file it takes the file and send its to another php file which sets up the header for download..


so its only 2 php files no matter how many files you have

1 to view all the files and select

1 to set up the header based on the filename selected on the first page.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Disabling stream?
Posted by: toumimi (---.111.116-78.rev.gaoland.net)
Date: December 03, 2009 11:51PM

You can even use the same file by adding a $_GET param winking smiley

ex: downloadFile.php => List all files of a folder
ex: downloadFile.php?file=test.txt => Send header and show the file to download it

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: Disabling stream?
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: December 04, 2009 12:07AM

Yup of course..

if _GET ISSET then you will skip the file listing and Start the header


Remember - Headers cant have any whitespace/char sent before it so leave no whitespace before your <?php

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote


Sorry, only registered users may post in this forum.