Bonjour ;-)
I have created a collaboration platform where users can upload files. However,
whenever I attempt to upload a document in the .rtf format, I get an error
message. All other document formats/file extensions work flawlessly.
My form code:
<form name=xxxx method="POST" action="xxxx.cfm"
enctype="multipart/form-data">
and 2 inputs, one for the text:
<input type="text" name="ladat" size="11">
and for the file:
<input name="fichier" type="file" size="29">
And here is the xxxx.cfm code for the script:
<cflock timeout="60" name="#session.sessionID#">
<cfif #FileExists(form.fichier)# is "NO">
<cfoutput>#form.fichier#</cfoutput> not exist!
<cfabort>
</cfif>
<CFFILE DESTINATION="d:\doc\my directory..."
ACTION="UPLOAD"
FILEFIELD="Fichier"
nameconflict="MAKEUNIQUE">
<cftransaction>
<cfquery DATASOURCE="#Session.xxxx#">
Insert INTO Table (ladate1, nom1)
Values('#form.ladat#', '#File.ServerFileName#.#File.ServerFileExt#')
</cfquery>
</cftransaction>
</cflock>
When I upload a file, my script returns the file name in a variable. However, in
the case of .rtf, the variable contains file contents rather than the file name?!
Such a file name cannot be found and I get an error
Do you know what is causing this kind of behavior? Could you point to my
mistake or provide me with a code sample that works?
Thanks in advance,
- Olivier
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