Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Download image from URL

    I am trying to create a link to an image on our web server that will prompt the user to download or open the image when it is clicked. It is done automaticly with a .doc but when an image link is clicked it opens in a new window, as you probably know. I dont know if it is possible to just ad a tag (similar to the _blank tag) that does this or if I will have to use javascript. Any ideas would be great
    Thank You

  • #2
    New Coder
    Join Date
    Oct 2007
    Posts
    84
    Thanks
    0
    Thanked 8 Times in 8 Posts
    Use .htaccess in the folder you want to force download of files.

    <Files *.jpeg>
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </Files>

  • #3
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm sorry I should have specified...The files are stored on an amazon S3 server So we do not have the ability to edit .htaccess

  • #4
    New Coder
    Join Date
    Oct 2007
    Posts
    84
    Thanks
    0
    Thanked 8 Times in 8 Posts
    I'm not familiar with Amazon hosting services. Sorry.

    You could write a server side script that would force download of files based on the information given to the script.

    Example would be http://yourhost/dir/download?f46se5u...erEtra7uw28dRe WHERE "f46se5uceZ6nunu6eKerEtra7uw28dRe" points to a reference to the path of the file in a database. Be cautious using this method.


  •  

    Posting Permissions

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