cfcontent changing name of file
Hi Folks I have a webpage called classroom.cfm It serves up a series of pdf handouts using cfcontent type = application/pdf file=#handoutFile# deleteFile = no handoutFile is the absolute path #handout# to a non web part of the server where the handouts are . Works fine except when someone wants to save the file to their computer the file is called classroom.pdf Is there a way to change the file name to #handout#. I have tried cfheader name=Content-Disposition value=filename=#handout# which doesn't work cfheader name=Content-Disposition value=attachment; filename=#handout# works but it forces the saving of the file i want the person to be able to read the file and then save it if they want. Thanks Rob ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353712 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfcontent changing name of file
try this. http://www.sitepoint.com/forums/showthread.php?640127-changing-filename-of-download-in-cfcontent On Sun, Dec 30, 2012 at 1:50 AM, Rob Voyle robvo...@voyle.com wrote: Hi Folks I have a webpage called classroom.cfm It serves up a series of pdf handouts using cfcontent type = application/pdf file=#handoutFile# deleteFile = no handoutFile is the absolute path #handout# to a non web part of the server where the handouts are . Works fine except when someone wants to save the file to their computer the file is called classroom.pdf Is there a way to change the file name to #handout#. I have tried cfheader name=Content-Disposition value=filename=#handout# which doesn't work cfheader name=Content-Disposition value=attachment; filename=#handout# works but it forces the saving of the file i want the person to be able to read the file and then save it if they want. Thanks Rob ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353713 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfcontent changing name of file
Hi Russ creating objects is beyond my expertise and I couldn't get the sitepoint idea to work. Kept getting an object error. However my suspicion is that it wouldn't solve my problem. cfheader name=Content-disposition value=attachment;filename=#downloadFile# / forces the browser to save the file not view the file. I want people to first view it and then save it if they want. Rob On 30 Dec 2012 at 2:34, Russ Michaels wrote: try this. http://www.sitepoint.com/forums/showthread.php?640127-changing-filen ame-of-download-in-cfcontent ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353714 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfcontent changing name of file
Rob, The following should work: cfheader name=Content-disposition value=inline;filename=#downloadFile# / -Dan On Saturday, December 29, 2012, Rob Voyle wrote: Hi Russ creating objects is beyond my expertise and I couldn't get the sitepoint idea to work. Kept getting an object error. However my suspicion is that it wouldn't solve my problem. cfheader name=Content-disposition value=attachment;filename=#downloadFile# / forces the browser to save the file not view the file. I want people to first view it and then save it if they want. Rob On 30 Dec 2012 at 2:34, Russ Michaels wrote: try this. http://www.sitepoint.com/forums/showthread.php?640127-changing-filen ame-of-download-in-cfcontent ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353715 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfcontent changing name of file
Hi Dan That doesn't work It opens the pdf fine: the url in the browser says www.host.com/webinars/classroom.cfm?handout=ai-session1.pdf and if I try to save the pdf file the file name is: classroom.pdf What I would like to do is save it as: ai-session1.pdf Rob On 29 Dec 2012 at 23:45, Dan G. Switzer, II wrote: Rob, The following should work: cfheader name=Content-disposition value=inline;filename=#downloadFile# / -Dan ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353716 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: cfcontent changing name of file
You need two tags: one to set the file name, one to send return the document cfheader name=Content-Disposition value=attachment; filename=myFile.pdf cfcontent type = application/pdf file=#handoutFile# DELETEFILE=no RESET=yes ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353717 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm