It doesn't have too!
Create a temp directory, store the files in here with a UID and use this
to know which file to get back.
After the file has been saved you then know what you need to do, so then
just move the file to the new location with cffile. This is not what I
would consider a final solution but it will help you out.
Regards,
Andrew Scott
-----Original Message-----
From: ArteCom Support [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 19 September 2001 1:57 AM
To: CF-Server
Subject: Tr: mime type
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