Cffile - mimetype of uplaoded csv incorrect (?) in 5.2.x

it might related to

We upload csv file using code like

<cfif structkeyexists(form, "upfiles")>
do upload.
	<cfset destDir = "c:/temp/">

	<cffile action="upload" filefield="upfiles" destination="#destDir#" result="uploadResult" nameconflict="overwrite" accept="text/csv,application/">
	<cfdump var="#uploadResult#">
<form id="form1" action="" enctype="multipart/form-data" method="post">
<input type="file" name="upfiles" id="upfiles" multiple="multiple" /><br /><br />
<input type="submit" name="submit" value="Upload" />

in Lucee 4.5
contentsubtype -
contenttype - application

In ACF 2016

However, now in Lucee 5.2.x
it is ‘text/plain’, and cffile will stop uploading.

Detail string only this [text/csv,application/] mime type are accepted
ErrorCode string 0
Extended_Info string
ExtendedInfo string
Message string The MIME type of the uploaded file [text/plain] was not accepted by the server.
StackTrace string lucee.runtime.exp.ApplicationException: The MIME type of the uploaded file [text/plain] was not accepted by the server.
at lucee.runtime.tag.FileTag.checkContentType(
at lucee.runtime.tag.FileTag._actionUpload(
at lucee.runtime.tag.FileTag.actionUpload(

This is what I use.

< cffile action=“upload” fileField="#form.file#" destination="/path/to/file" nameConflict=“MakeUnique”/>
< cfset fileext = cffile.clientfileext>
< cfif fileext eq ‘jpg’ or fileext eq ‘png’ or fileext eq ‘pdf’ or fileext eq ‘jpeg’>
< cffile action=“rename” source="/path/to/file/#session.sid#/#cffile.serverfile#" destination="/path/to/file/#session.sid#/#cffile.clientfile#" attributes=“normal”/>
< /cfif>

Hi @Allen_Weng,

I’ve tested this on ACF and Lucee & Issue is fixed on latest Lucee version, Now it is working as expected.

contentsubtype - csv
contenttype	- text

Can you please check with latest version & Let me know if still issue is reproduced .

1 Like

Thank you. I have verified it is working in Lucee - will this fix be part of 5.2.8 release ??