|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
How to initiate download dialog when downloading jpg files?
I¹m sure there¹s an easy way to do this, but I don¹t know what it is.Butch Zaccheo 05/07/04 12:09 P http://www.cfm-applications.com/expressive_v1_b2/index.cfm?entryID=2055Bryan F. Hogan 05/07/04 12:11 P Hey Bryan... I get this error when I try and use the code you provided? I¹mButch Zaccheo 05/07/04 01:36 P What is the value of url.image?Bryan F. Hogan 05/07/04 02:01 P Actually I figured out the syntax error (strange characters when I pastedButch Zaccheo 05/07/04 02:09 P Doing it like below returns the image in the browser?Bryan F. Hogan 05/07/04 02:15 P I probably should give you a little more info.... I¹m testing this in IE 5Butch Zaccheo 05/07/04 02:20 P I don't know of another way. What is needed for this to work is to trickBryan F. Hogan 05/07/04 02:27 P thanx again for the help bryan...Butch Zaccheo 05/07/04 03:24 P I¹m sure there¹s an easy way to do this, but I don¹t know what it is. I want the ³Save As² dialog box to open when a link to an image file is clicked on. Right now (as I¹m sure you are familiar with) it displays the image in the browser window rather than opening the ³Save As² dialog. Any help would be much appreciated. BZaccheo http://www.cfm-applications.com/expressive_v1_b2/index.cfm?entryID=2055 > I want the ³Save As² dialog box to open when a link to an image file is > clicked on. Right now (as I¹m sure you are familiar with) it displays the > image in the browser window rather than opening the ³Save As² dialog. Hey Bryan... I get this error when I try and use the code you provided? I¹m not sure what the problem is... BZaccheo Invalid token ' ' found on line 5 at column 1. The CFML compiler was processing: * a cfheader tag beginning on line 4, column 7. * a cfheader tag beginning on line 4, column 7. The error occurred in C:\Domains\edirolextra.com\wwwroot\sitedirector\site\details.cfm: line 5 3 : <cftry> 4 : <cfheader name="content-disposition" 5 : value="attachment;filename=#url.image#"> 6 : <cfcontent type="application/unknown" 7 : file="#request.siteDirectory##request.delimiter#images#request.del imiter#site_images#request.delimiter##url.image#" deletefile="no"> On 5/7/04 9:09 AM, "Bryan F. Hogan" <bryan.hogan@cfm-applications.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- What is the value of url.image? Butch Zaccheo wrote: > Hey Bryan... I get this error when I try and use the code you provided? I¹m > not sure what the problem is... Actually I figured out the syntax error (strange characters when I pasted content) ... and it seems to be running fine now... but... when I run the script, it just loads the image in the browser window without initiating the dialog box. On 5/7/04 10:59 AM, "Bryan F. Hogan" <bryan.hogan@cfm-applications.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Doing it like below returns the image in the browser? test.cfm <a href="download.cfm?image=test.jpg">Download test.jpg</a> download.cfm <cftry> <cfheader name="content-disposition" value="attachment;filename=#url.image#"> <cfcontent type="application/unknown" file="#expandPath('..')&'\documents\'&url.image#" deletefile="no"> <cflocation url="test.cfm" addtoken="no"> <cfcatch type="any"> </cfcatch> </cftry> Butch Zaccheo wrote: > when I run the > script, it just loads the image in the browser window without initiating the > dialog box. I probably should give you a little more info.... I¹m testing this in IE 5 OSX... It works fine on the pc side but not on the mac side... is there another way of doing this.. maybe with a javascript? On 5/7/04 11:11 AM, "Bryan F. Hogan" <bryan.hogan@cfm-applications.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- the >> > dialog box. I don't know of another way. What is needed for this to work is to trick the browser into thinking it is not a known document type. Try this content-type "application/x-msdownload" or "do the google" (c) by me ;-) http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=content-type%2Bmac%2Bie Butch Zaccheo wrote: > I probably should give you a little more info.... I¹m testing this in IE 5 > OSX... It works fine on the pc side but not on the mac side... is there > another way of doing this.. maybe with a javascript? thanx again for the help bryan... I don¹t think there is a clear way to make it work for mac browsers... I¹ll have to try a different route... On 5/7/04 11:24 AM, "Bryan F. Hogan" <bryan.hogan@cfm-applications.com> wrote: ----- Excess quoted text cut - see Original Post for more -----
|
February 08, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||