Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Web Design (WordPress, Joomla, etc.) Code for buttons that will download files to a desktop

  • Code for buttons that will download files to a desktop

    Posted by Dominic Di-natale on January 16, 2007 at 1:47 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

    Curtis Thompson replied 19 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Curtis Thompson

    January 16, 2007 at 3:57 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy