download a file w/out right-click

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Vic Kick Ass
Forum Newbie
Posts: 5
Joined: Tue Apr 13, 2004 10:33 pm

download a file w/out right-click

Post 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!!!
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post 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.."
Vic Kick Ass
Forum Newbie
Posts: 5
Joined: Tue Apr 13, 2004 10:33 pm

Post by Vic Kick Ass »

Wow - is this forum always so amazing? Such a fast and perfect answer! Thank you so much!
Post Reply