Add link to download a file directly ?? (3 posts)

  1. howardballinger
    Posted 3 years ago #

    Hi, I want to put links on a page that, if the visitor clicks them, will start a file to downloading right away -- rather then them needing to right-click or control-click and select something from a context menu. What's the best way to do that ??

    Thanks -- Howard Ballinger

  2. s_ha_dum
    Posted 3 years ago #

    I don't believe that you can do that with pure HTML. That is, just by inserting a link, at least not with file types that browsers can display like JPEGs. It does work with .zip files and some other things that browsers do not natively display.

    To do this with all file types you need to force-feed the browser, which requires some PHP.


  3. Andrew Bartel
    Posted 3 years ago #

    David Walsh has a great post on it: http://davidwalsh.name/php-force-download

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.