Mark asked:

> Every time I try this, the try/catch around my upload takes over due to
> violating the "accept" list. I can't even get to the IsImageFile()
> check.
> Even if I take a file, change the extension and how it is saved (Save
> as
> type...), it won't get past the try catch.  

What you can do is test things before you do the CFFILE action="upload". As
has been discussed here, the upload takes place before the CFFILE tag ever
runs. So you can do your manual tests of the file with CFML in the page that
accepts the form post. 

Indeed, you don't even really need the CFFILE tag at all, really. You could
do the move yourself, and the checks that it's doing. I'm not saying you
should do that as a matter of course, but I'm saying that you can do things
before you do the CFFILE and then attempt the CATCH after it.

This is definitely stuff that surprises people (that the CFFILE doesn't
really do the upload, or that you can do things to the temp file before
using the CFFILE At all), so no one should be surprised at getting their
head around it. :-) I blogged it myself a few years ago, when it was coming
up a lot back then:

If a file is uploaded and no CFFILE Upload tag exists to process it, does it
really upload?
[http://www.carehart.org/blog/client/index.cfm/2006/5/7/cfform_not_doing_upl
oad]

Hope the ideas above help, Mark.

/charlie

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Mark Davis
> Sent: Friday, July 31, 2009 11:32 AM
> To: [email protected]
> Subject: [houcfug] Re: cfcatch question
> 
> 
>  Mike,
> 
> I have been hammering this out this morning.  I am trying to test the
> scenario where someone takes a file (such as excel or exe or something)
> and
> saves it as an image file.
> 
> Every time I try this, the try/catch around my upload takes over due to
> violating the "accept" list. I can't even get to the IsImageFile()
> check.
> Even if I take a file, change the extension and how it is saved (Save
> as
> type...), it won't get past the try catch.  How did you get yours to do
> that?
> 



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Houston ColdFusion 
Users' Group" discussion list.
To unsubscribe, send email to [email protected]
For more options, visit http://groups.google.com/group/houcfug?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to