SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple file downloads, how?

    Hi, I have what I assume is a really simple request and not sure if I need CGI, Javascript, html, php or what to do it.

    I have a page of thumbnailed images and I want a user click a link under each image to download a large version of the image file, ie a box opens up and asks where they want to save it.

    I don't need any fancy extras like logging downloads or security etc,

    Thanks in advance for any help

    Tim

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You could just link to the big image. If the user wants to save it they can right click the link and choose "save as".

    If you want to *attempt* to force a download instead, you'll need a server-side script (perl/cgi, php, your choice) which sends some headers to the browser, opens the image file, then outputs its binary data to the browser.

  3. #3
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,398
    Mentioned
    65 Post(s)
    Tagged
    1 Thread(s)
    Maybe this topic would be of use to you: especially the <Files> directive for Apache.


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
  •