WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. howardballinger
    Member
    Posted 1 year 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
    Member
    Posted 1 year 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.

    http://webdesign.about.com/od/php/ht/force_download.htm

  3. Andrew Bartel
    Member
    Posted 1 year 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

Tags

No tags yet.