FORUMS: list search recent posts

Code for buttons that will download files to a desktop

COW Forums : Web Design

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dominic Di-NataleCode for buttons that will download files to a desktop
by on Jan 16, 2007 at 1:47:40 pm

I'd like to get a rollover or clickable button to directly download a file onto a user's desktop (ie "Click here to download" type of thing).
I have a large video file that my users wish to save straight to disk.
How do I do this?
Thanx in advance!

* MacBook Pro 15.2" 2GB RAM
* G5 MacDual 2.5GHz PowerPC G5 8GB RAM
* 30" Apple studio display
* iMac G4 1Gb RAM
* Sony HVR-Z1
* One office cat who sits on my laser printer to keep warm


Return to posts index

Curtis ThompsonRe: Code for buttons that will download files to a desktop
by on Jan 16, 2007 at 3:57:31 pm

hello...

you can force a download of an item by streaming it in a scripting language (like php) with a raw application/octet-stream mime type. otherwise, if you link to a file that the user's computer knows about (like a .mov file), their browser will either play it inline or hand it along to the helper. in the case of the former, you won't get the chance to save it to your desktop, but with the latter you will typically get a "do you want to open or save this file" dialog...

with a movie file, there is a good chance that it might play inline for some people. they can always right-click and say "save link as", so you can either do the above php wrapper (if you have the scripting knowledge or urge to learn - it's just a few lines of code) or you can just link to it directly (like "<A HREF='/path/to/movie.mov'>") and add the note on the page about potentially needing to right click (or control click on mac if you are still using a one-button mouse) to download...

sitruc


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]