Ajas,

Yes, but to do that he'd have to save the file to the drive to get to that
point, a big security no-no. He won't have to cfthrow if his cffile tag is
already throwing.

-- 
Billy Cravens

On Thu, Jul 30, 2009 at 2:37 PM, Ajas Mohammed <[email protected]> wrote:

> Yeap, have a custom exception and then use CFThrow to throw custom
> exception.
>
> <cfif somecase>
>     regular stuff
> <cfselseif>
>      <cfthrow type="message">
> </cfif>
>
> This code will catch that custom exception...
> <cfcatch type="message">
>             <cflocation url="ErrorMsg.cfm">
>  </cfcatch>
>
>
> <Ajas Mohammed />
> http://ajashadi.blogspot.com
> We cannot become what we need to be, remaining what we are.
> No matter what, find a way. Because thats what winners do.
> You can't improve what you don't measure.
> Quality is never an accident; it is always the result of high intention,
> sincere effort, intelligent direction and skillful execution; it represents
> the wise choice of many alternatives.
>
>
>
> On Thu, Jul 30, 2009 at 3:28 PM, Mike G <[email protected]> wrote:
>
>>
>> Are you trying to catch on upload, or catching as soon as you start
>> trying to process the uploaded file.
>>
>> If the latter, in the top of your cftry, evaluate cfile.serverfile
>> extension (don't have the docs in front of me for the exact var that
>> holds it)  If it is not an allowable type, then use cfthrow and throw
>> a custom exception.  Then in you cfcatch, trap for that custom
>> exception.  pretty simple to do.
>>
>> On Thu, Jul 30, 2009 at 2:12 PM, Mark Davis<[email protected]>
>> wrote:
>> > hey gang,
>> >
>> > I have some pages where users upload photos and resumes.  The mime types
>> > allowed are limited to standard stuff.  The page  is wrapped in a
>> try/catch,
>> > that currently logs everything to one certain log file.  We get a lot of
>> > "errors" where the user is trying to upload an exe as a photo and crazy
>> > stuff like that.  I want a specific cfcatch type="" to catch only those
>> > errors for mime type exceptions, handle those one way, then catch
>> everything
>> > else and handle a different way.  I have the everything else, but I am
>> > having issues figuring out the mime type catch.  anyone?  thanks
>> >
>> >
>> >
>> > Mark Davis | Developer
>> >
>> >
>> .........................................................................................................................
>> >
>> > Round Table Group, Inc.
>> >
>> > (281) 717-4575
>> >
>> > [email protected]
>> >
>> > www.roundtablegroup.com
>> >
>> >
>> .........................................................................................................................
>> >
>> >
>> >
>> > The Leading Authority in Expert Witness Search & ReferralTM
>> >
>> > CONFIDENTIALITY NOTE: This e-mail, and any attachments thereto, is
>> intended
>> > only for use by the addressee(s) named in the message originated by me
>> and
>> > may contain legally privileged and/or confidential information. If the
>> > reader of this message is not the intended recipient, you are hereby
>> > notified that any dissemination, distribution or copying of this
>> > communication is strictly prohibited. If you have received this email in
>> > error, please notify me immediately by telephone and permanently delete
>> the
>> > original and any copy of the email, and any printout thereof. Thank you.
>> >
>> >
>> > >
>> >
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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