CFFILE / CFCATCH
I'm trying to cfcatch cffile mime type errors. I can't see where I'm going wrong. ~| 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:345949 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CFFILE / CFCATCH
Jenny, I am going to assume that you have tried to cfdump and abort in the cfcatch to see what the message contains. Failing that I do know that some of these messages have hidden characters and will not match even if you try. I don't have the link handy at the moment, but I did write a blog about this sort of thing some months ago. Regards, Andrew Scott http://www.andyscott.id.au/ > -Original Message- > From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] > Sent: Thursday, 30 June 2011 2:20 PM > To: cf-talk > Subject: CFFILE / CFCATCH > > > I'm trying to cfcatch cffile mime type errors. > > I can't see where I'm going wrong. > > > > destination="#session.currentDirectory#" > filefield="form.fileField" nameconflict="overwrite" accept="image/jpeg, > image/jpg, image/pjpeg, image/gif, image/png"> type="any"> accepted", cfcatch.Message)> > > > ~| 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:345950 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFFILE / CFCATCH
Unless something has changed in recent versions of CF, in addition to cffile's accept arg, after your you should always check extension of file saved to disk and, if illegal, immediately delete file. Reason: those mimetypes come from end-user's browser and can be wrong/spoofed/unpredictable (i.e. you won't find a set-in-stone one-to-one relationship between mimtypes and extensions...it changes based on OS, browser, etc). Having said that, I concur with Andrew: try "to cfdump and abort in the cfcatch to see what the message contains." On Thu, Jun 30, 2011 at 1:56 AM, Andrew Scott wrote: > > Jenny, I am going to assume that you have tried to cfdump and abort in the > cfcatch to see what the message contains. Failing that I do know that some > of these messages have hidden characters and will not match even if you > try. > > I don't have the link handy at the moment, but I did write a blog about > this > sort of thing some months ago. > > > Regards, > Andrew Scott > http://www.andyscott.id.au/ > > > > > -Original Message- > > From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] > > Sent: Thursday, 30 June 2011 2:20 PM > > To: cf-talk > > Subject: CFFILE / CFCATCH > > > > > > I'm trying to cfcatch cffile mime type errors. > > > > I can't see where I'm going wrong. > > > > > > > > > destination="#session.currentDirectory#" > > filefield="form.fileField" nameconflict="overwrite" accept="image/jpeg, > > image/jpg, image/pjpeg, image/gif, image/png"> > type="any"> > accepted", cfcatch.Message)> > > > > > > > > > > ~| 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:345952 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CFFILE / CFCATCH
Hi John, Thanks for the reply. Yes, I dumped the results of the cfcatch. Strangely, the cflocation is working, but the session.sysmessage is not working. So although the use correctly gets returned to the calling page I'm unable to let them know why. If you have a link to your blog I'd be very interested to read it, please. Thanks, Jenny >>-Original Message- >>From: Andrew Scott [mailto:andr...@andyscott.id.au] >>Sent: 30 June 2011 07:57 >>To: cf-talk >>Subject: RE: CFFILE / CFCATCH >> >> >> >>Jenny, I am going to assume that you have tried to cfdump and abort in the >>cfcatch to see what the message contains. Failing that I do know that some >>of these messages have hidden characters and will not match even >>if you try. >> >>I don't have the link handy at the moment, but I did write a blog >>about this >>sort of thing some months ago. >> >> >>Regards, >>Andrew Scott >>http://www.andyscott.id.au/ >> >> >> >>> -----Original Message- >>> From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] >>> Sent: Thursday, 30 June 2011 2:20 PM >>> To: cf-talk >>> Subject: CFFILE / CFCATCH >>> >>> >>> I'm trying to cfcatch cffile mime type errors. >>> >>> I can't see where I'm going wrong. >>> >>> >>> >>> >> destination="#session.currentDirectory#" >>> filefield="form.fileField" nameconflict="overwrite" accept="image/jpeg, >>> image/jpg, image/pjpeg, image/gif, image/png"> >> type="any"> >> accepted", cfcatch.Message)> >> >>> >>> >>> >> >> >> ~| 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:345954 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CFFILE / CFCATCH
Jenny it was me not John, anyway here is the link. http://www.andyscott.id.au/2010/9/19/ColdFusion-and-the-expression-does-not- contain-is-broken Regards, Andrew Scott http://www.andyscott.id.au/ > -Original Message- > From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] > Sent: Friday, 1 July 2011 12:11 AM > To: cf-talk > Subject: RE: CFFILE / CFCATCH > > > Hi John, > > Thanks for the reply. > > Yes, I dumped the results of the cfcatch. > > Strangely, the cflocation is working, but the session.sysmessage is not > working. So although the use correctly gets returned to the calling page I'm > unable to let them know why. > > If you have a link to your blog I'd be very interested to read it, please. > > Thanks, > > Jenny ~| 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:345955 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFFILE / CFCATCH
Perhaps do this...? On Thu, Jun 30, 2011 at 9:10 AM, Jenny Gavin-Wear < jenn...@fasttrackonline.co.uk> wrote: > > Hi John, > > Thanks for the reply. > > Yes, I dumped the results of the cfcatch. > > Strangely, the cflocation is working, but the session.sysmessage is not > working. So although the use correctly gets returned to the calling page > I'm unable to let them know why. > > If you have a link to your blog I'd be very interested to read it, please. > > Thanks, > > Jenny > > >>-Original Message- > >>From: Andrew Scott [mailto:andr...@andyscott.id.au] > >>Sent: 30 June 2011 07:57 > >>To: cf-talk > >>Subject: RE: CFFILE / CFCATCH > >> > >> > >> > >>Jenny, I am going to assume that you have tried to cfdump and abort in > the > >>cfcatch to see what the message contains. Failing that I do know that > some > >>of these messages have hidden characters and will not match even > >>if you try. > >> > >>I don't have the link handy at the moment, but I did write a blog > >>about this > >>sort of thing some months ago. > >> > >> > >>Regards, > >>Andrew Scott > >>http://www.andyscott.id.au/ > >> > >> > >> > >>> -Original Message- > >>> From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] > >>> Sent: Thursday, 30 June 2011 2:20 PM > >>> To: cf-talk > >>> Subject: CFFILE / CFCATCH > >>> > >>> > >>> I'm trying to cfcatch cffile mime type errors. > >>> > >>> I can't see where I'm going wrong. > >>> > >>> > >>> > >>> >>> destination="#session.currentDirectory#" > >>> filefield="form.fileField" nameconflict="overwrite" accept="image/jpeg, > >>> image/jpg, image/pjpeg, image/gif, image/png"> >>> type="any"> >>> accepted", cfcatch.Message)> > >> > >>> > >>> > >>> > >> > >> > >> > > ~| 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:345956 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFFILE / CFCATCH
+1. Also, you can drop the extraneous cfoutput around the cffile. Variables are automatically outputted if used as an attribute value in a cftag and wrapped in #. Sent from my iPhone. On 2011-06-30, at 2:56 AM, "Andrew Scott" wrote: > > Jenny, I am going to assume that you have tried to cfdump and abort in the > cfcatch to see what the message contains. Failing that I do know that some > of these messages have hidden characters and will not match even if you try. > > I don't have the link handy at the moment, but I did write a blog about this > sort of thing some months ago. > > > Regards, > Andrew Scott > http://www.andyscott.id.au/ > > > >> -Original Message- >> From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] >> Sent: Thursday, 30 June 2011 2:20 PM >> To: cf-talk >> Subject: CFFILE / CFCATCH >> >> >> I'm trying to cfcatch cffile mime type errors. >> >> I can't see where I'm going wrong. >> >> >> >> > destination="#session.currentDirectory#" >> filefield="form.fileField" nameconflict="overwrite" accept="image/jpeg, >> image/jpg, image/pjpeg, image/gif, image/png"> > type="any"> > accepted", cfcatch.Message)> > >> >> >> > > > ~| 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:346016 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CFFILE / CFCATCH
Thanks Michael, I looked for the dump first. The only problem is the session variable not being set inside the cfcatch. I'm sure I am catching the error for the cflocation to trigger. Jenny >>-Original Message- >>From: Michael Grant [mailto:mgr...@modus.bz] >>Sent: 01 July 2011 00:04 >>To: cf-talk >>Subject: Re: CFFILE / CFCATCH >> >> >> >>+1. >> >> >> >>Also, you can drop the extraneous cfoutput around the cffile. >>Variables are automatically outputted if used as an attribute >>value in a cftag and wrapped in #. >> >>Sent from my iPhone. >> >> >>On 2011-06-30, at 2:56 AM, "Andrew Scott" wrote: >> >>> >>> Jenny, I am going to assume that you have tried to cfdump and >>abort in the >>> cfcatch to see what the message contains. Failing that I do >>know that some >>> of these messages have hidden characters and will not match >>even if you try. >>> >>> I don't have the link handy at the moment, but I did write a >>blog about this >>> sort of thing some months ago. >>> >>> >>> Regards, >>> Andrew Scott >>> http://www.andyscott.id.au/ >>> >>> >>> >>>> -Original Message- >>>> From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] >>>> Sent: Thursday, 30 June 2011 2:20 PM >>>> To: cf-talk >>>> Subject: CFFILE / CFCATCH >>>> >>>> >>>> I'm trying to cfcatch cffile mime type errors. >>>> >>>> I can't see where I'm going wrong. >>>> >>>> >>>> >>>> >>> destination="#session.currentDirectory#" >>>> filefield="form.fileField" nameconflict="overwrite" accept="image/jpeg, >>>> image/jpg, image/pjpeg, image/gif, image/png"> >>> type="any"> >>> accepted", cfcatch.Message)> >>> >>>> >>>> >>>> >>> >>> >>> >> >> ~| 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:346017 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFFILE / CFCATCH
Looks like you're the victim of scenario #2 in this KB article: http://kb2.adobe.com/cps/181/tn_18171.html On Thu, Jun 30, 2011 at 6:57 PM, Jenny Gavin-Wear < jenn...@fasttrackonline.co.uk> wrote: > > Thanks Michael, > > I looked for the dump first. > > The only problem is the session variable not being set inside the cfcatch. > > I'm sure I am catching the error for the cflocation to trigger. > > Jenny > > > >>-Original Message- > >>From: Michael Grant [mailto:mgr...@modus.bz] > >>Sent: 01 July 2011 00:04 > >>To: cf-talk > >>Subject: Re: CFFILE / CFCATCH > >> > >> > >> > >>+1. > >> > >> > >> > >>Also, you can drop the extraneous cfoutput around the cffile. > >>Variables are automatically outputted if used as an attribute > >>value in a cftag and wrapped in #. > >> > >>Sent from my iPhone. > >> > >> > >>On 2011-06-30, at 2:56 AM, "Andrew Scott" > wrote: > >> > >>> > >>> Jenny, I am going to assume that you have tried to cfdump and > >>abort in the > >>> cfcatch to see what the message contains. Failing that I do > >>know that some > >>> of these messages have hidden characters and will not match > >>even if you try. > >>> > >>> I don't have the link handy at the moment, but I did write a > >>blog about this > >>> sort of thing some months ago. > >>> > >>> > >>> Regards, > >>> Andrew Scott > >>> http://www.andyscott.id.au/ > >>> > >>> > >>> > >>>> -Original Message- > >>>> From: Jenny Gavin-Wear [mailto:jenn...@fasttrackonline.co.uk] > >>>> Sent: Thursday, 30 June 2011 2:20 PM > >>>> To: cf-talk > >>>> Subject: CFFILE / CFCATCH > >>>> > >>>> > >>>> I'm trying to cfcatch cffile mime type errors. > >>>> > >>>> I can't see where I'm going wrong. > >>>> > >>>> > >>>> > >>>> >>>> destination="#session.currentDirectory#" > >>>> filefield="form.fileField" nameconflict="overwrite" > accept="image/jpeg, > >>>> image/jpg, image/pjpeg, image/gif, image/png"> >>>> type="any"> >>>> accepted", cfcatch.Message)> url="folder-view.cfm"> > >>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >> > >> > > ~| 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:346018 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CFFILE / CFCATCH
Many thanks for your reply, interesting article. I think this article would only apply if I was losing all session variables? >>-Original Message- >>From: morgan l [mailto:greyk...@gmail.com] >>Sent: 01 July 2011 02:16 >>To: cf-talk >>Subject: Re: CFFILE / CFCATCH >> >> >> >>Looks like you're the victim of scenario #2 in this KB article: >>http://kb2.adobe.com/cps/181/tn_18171.html >> >>On Thu, Jun 30, 2011 at 6:57 PM, Jenny Gavin-Wear < >>jenn...@fasttrackonline.co.uk> wrote: >> ~| 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:346023 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFFILE / CFCATCH
On Fri, Jul 1, 2011 at 4:16 AM, morgan l wrote: > > Looks like you're the victim of scenario #2 in this KB article: > http://kb2.adobe.com/cps/181/tn_18171.html That article applies to CF5 and I doubt Jenny is running CF5. -- Mack ~| 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:346065 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm