Thanks for that idea Bruce - dunno why I didn't think of that. Programmer's
block :(
Will
----- Original Message -----
From: "Bruce Sorge" <[EMAIL PROTECTED]>
Newsgroups: gradwell.lists.cftalk
Sent: Sunday, February 10, 2002 3:01 AM
Subject: Re: Detecting file-types on upload
> How about using CFCATCH and CFTRY in your application?
> <cftry>
>
> <cffile action="UPLOAD" filefield="FileFildName
> destination="FileServerPath\" nameconflict="MAKEUNIQUE"
accept="image/gif">
> <cfcatch type="Any">
> <cfset ErrMsg = 'You have entered an invalid file type. The only
allowed
> file types are .jpg and .gif'>
> </cfcatch>
> </cftry>
> <cfif LEN('ErrMsg')>
> <cfoutput>
> #ErrMsg#
> <cfabort>
> </cfoutput>
> </cfif>
>
> ----- Original Message -----
> From: "W Luke" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Saturday, February 09, 2002 3:00 PM
> Subject: Detecting file-types on upload
>
>
> > If I use the Accept attribute of cffile (ACCEPT="image/gif,image/pjpeg")
> to
> > accept *just* GIFs and JPEGs, and a user uploads say a bitmap, how can I
> > leave them a custom-error rather than the CF-produced error? I need to
do
> a
> > <Cfif> loop on file.serverfile, but I've not dealt with file-types
before
> >
> > I'd appreciate any help
> >
> > Thanks
> >
> > Will
> > ---
> > "A woman drove me to drink and I didn't even have the decency to thank
> > her." --W.C. Fields
> >
> >
>
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists