Page 1 of 1

download a file w/out right-click

Posted: Tue Apr 13, 2004 10:33 pm
by Vic Kick Ass
In case I am asking something "stupid" - I apologize, but I have searched to high hell and haven't been able to find any direction. Maybe I am just searching the wrong phrases - but in any case I NEED HELP:

I want a php page that will cause a wmv file to be DOWNLOADED to the user's machine, and NOT fetched by the browser and played in the media player.

I don't want to involve myself in a whole "download manager" pre-cooked script package. I am sure (sure hoping!) that there are a few simple lines I can stick on a page to modify a header or something, so the file downloads and saves somewhere on their harddrive.

PUHHHHLEASE HEWLP!

- Right clicking is out of the question, because (1) i've developed the client side, for various stubborn preferences and reasons, to make the href go to "javascript:void(0)" (2) I could change that, I guess, but that would be to admit defeat - which is UNACCEPTABLE!!!

Posted: Tue Apr 13, 2004 10:35 pm
by markl999
See http://php.net/header
There are examples on that page of 'forcing' a download prompt, where it begins " If you want the user to be prompted to save the data you are sending.."

Posted: Tue Apr 13, 2004 10:51 pm
by Vic Kick Ass
Wow - is this forum always so amazing? Such a fast and perfect answer! Thank you so much!