开发者

cffile not working at all

开发者 https://www.devze.com 2023-04-12 14:15 出处:网络
cffile is giving a head ache now. My cfm is like this - ` <cfif session.ismac and session.browsermake eq \"firefox\">

cffile not working at all

cffile is giving a head ache now. My cfm is like this -

`

<cfif session.ismac and session.browsermake eq "firefox">
<cfset size = "55">
</cfif> 
<cfset onChange = "document.frmMain.submit1.disabled = true;setdisplayname(this,this.form.dummy);">
<cfif displayname EQ "">
<cfset size = "document.frmMain.submit1.disabled = true;setdisplayname(this,this.form.displayname);">
</cfif> 


<cfinput type="开发者_开发问答file" name="File#thisUploader#" id="File#thisUploader#" size="#size#" onKeyPress="return false;" onchange="#onChange#">

`

and in my cfc the code is like this -

<cffile accept="image/*" action="upload" destination="#application.artworkfilepath#\bulkuploads\#session.loginname#\#form.category#\" filefield="form.File#thisUploader#" nameconflict="makeunique">

and if I dump - <cfoutput> You uploaded #cffile.ClientFileName#.#cffile.ClientFileExt# successfully to #cffile.ServerDirectory#. </cfoutput> <cfabort>

I get corrct things and no error. But when i look into the folder there is nothing.

Anyidea? I have added the dump of cffile now. What do you make out of it? cfform code is like this <cfform id="frmMain" name="frmMain" action="process_multi.cfm" enctype="multipart/form-data" target="_self" method="post">


do a fileExists() directly after the statement and let us know what that says...

you don't have a directorywatcher on the directory do you?


Your cffile nameconfict attribute is set to makeunique, which tells ColdFusion to rename the file to something new when it arrives at the server--if the file already exists.

However, you are using cffile.ClientFileName and cffile.ClientFileExt to refer to the file file--which maps to the unchanged file name as it was received during upload.

Change your code references to cffile.ServerFileName and cffile.ServerFileExt for the final renamed result.

0

精彩评论

暂无评论...
验证码 换一张
取 消