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