• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Force Download from URL

Explorer ,
Dec 16, 2011 Dec 16, 2011

Copy link to clipboard

Copied

Is it possible to force download an image from a URL instead of a network path?

I have secure images on a private SANS server that I can show through the URL (thanks to services granted by my server admins) but not have path (folder) access from the web server to the SANS so I cannot use a path to allow visitors to download images. Is there any other way to do it? Thanks!

TOPICS
Advanced techniques

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 16, 2011 Dec 16, 2011

Copy link to clipboard

Copied

You can't do that directly from the CFCONTENT tag, but there's no reason why you can't fetch it with CFHTTP, store it locally, then use CFCONTENT to serve that.

Dave Watts, CTO, Fig Leaf Software

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 16, 2011 Dec 16, 2011

Copy link to clipboard

Copied

I couldn't find a good example of how to save it locally so i could server it then delete the file. Do you know a good example or have one?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Dec 21, 2011 Dec 21, 2011

Copy link to clipboard

Copied

LATEST

First (taken from the Adobe Docs)

     <cfhttp method="Get" url="http://www.adobe.com/adobe/accessibility/images/spotlight.jpg" path="c:\temp" file="My_Savedimage.jpg">

Get spotlight.jog and save into c:\temp\mysavedimage.jpg

Second :

<cfheader name="Content-disposition" value="attachment;filename=thefilenametodownload.jpg" />


<cfcontent type="image/jpg" file="c:\temp\My_Savedimage.jpg" />

Et voila

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation