Upload the file to a tempory directory then move it.  Your only other
option would be to use JavaScript to try and get the extension as the
filename is entered and update a hidden form variable which would affect
the actions of the submission screen.

Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612

On Tue, 18 Sep 2001, ArteCom Support wrote:

> Thanks for your reply but i nee to know the mime type or extension
> before the <cffile action="upload"...
> because destination folder and filename (+id from the database record
> previously inserted) depends of that.
>
> J�r�me
>
>
> ----- Original Message -----
> From: Dave Watts
> To: '[EMAIL PROTECTED]'
> Cc: '[EMAIL PROTECTED]'
> Sent: Tuesday, September 18, 2001 5:51 PM
> Subject: RE: mime type
>
>
> > Is it possible to know the mime type of an uploaded file ?
> > Or to get his extension ?
> >
> > when i read the value of file field, i got
> > "C:\WINNT\TEMP\ACF02.tmp", so i don't have the extension
> > and i don't know how to get the mime type !
>
> After you process the file upload with CFFILE ACTION="UPLOAD", you'll
> have a
> bunch of variables available to you in the File scope:
>
> attemptedServerFile
>  Initial name ColdFusion used when attempting to save a file
>
> clientDirectory
>  Directory location of the file uploaded from the client's system
>
> clientFile
>  Name of the file uploaded from the client's system
>
> clientFileExt
>  Extension of the uploaded file on the client's system without a period,
> for
> example, txt not .txt
>
> clientFileName
>  Filename, without an extension, of the uploaded file on the client's
> system
>
>
> contentSubType
>  MIME content subtype of the saved file
>
> contentType
>  MIME content type of the saved file
>
> dateLastAccessed
>  Date and time the uploaded file was last accessed
>
> fileExisted
>  Indicates (Yes or No) whether or not the file already existed with the
> same
> path
>
> fileSize
>  Size of the uploaded file
>
> fileWasAppended
>  Indicates (Yes or No) whether ColdFusion appends the uploaded file to
> an
> existing file
>
> fileWasOverwritten
>  Indicates (Yes or No) whether ColdFusion overwrites a file
>
> fileWasRenamed
>  Indicates (Yes or No) whether the uploaded file is renamed to avoid a
> name
> conflict
>
> fileWasSaved
>  Indicates (Yes or No) whether Cold Fusion saves a file
>
> oldFileSize
>  Size of a file that was overwritten in the file upload operation
>
> serverDirectory
>  Directory of the file saved on the server
>
> serverFile
>  Filename of the file saved on the server
>
> serverFileExt
>  Extension of the uploaded file on the server, without a period
>
> serverFileName
>  Filename, without an extension, of the uploaded file on the server
>
> timeCreated
>  Time the uploaded file was created
>
> timeLastModified
>  Date and time of the last modification to the uploaded file
>
> (I copied this straight from the docs, which explains the slightly funky
> formatting.) You'll be interested in File.ContentType and
> File.ContentSubType.
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> voice: (202) 797-5496
> fax: (202) 797-5444
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with 
'unsubscribe' in the body or visit the list page at www.houseoffusion.com

Reply via email to