Results 1 to 2 of 2

Thread: html5 - click to download

  1. #1
    Join Date
    Aug 2013
    Beans
    59

    Question html5 - click to download

    Hi all,

    how do I perform "click to download" in html5 ?
    Let's say, I got .jpg file at web hosting.
    Usually when someone clicks on http://site.com/img/file.jpg then this file displays in browser.
    My need is to avoid displaying of file but to forse download this file.
    How do I perform it?
    Is it possible at all?

  2. #2
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,169
    Distro
    Kubuntu

    Re: html5 - click to download

    in the header set a content disposition attachment
    php can do this
    example 2 here
    http://www.w3schools.com/Php/func_http_header.asp

    A example of html5 download would be saving a image created client side in a canvas element, lat time i looked into that i think there was browser support issues
    Last edited by pqwoerituytrueiwoq; April 13th, 2014 at 04:14 PM.
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •