mchristopher
asked on
ColdFusion error when uploading files: The files upload action requires forms to use enctype="multipart/form-data".
The following code fails and shows the error output in the title. What the heck is going on? Thanks for considering this.
<form method="post" enctype="multipart/form-da ta">
Select a file:
<input type="file" name="fileUpload">
<input type="submit" value="Upload File">
</form>
<cffile action="upload"
accept = "application/pdf,applicati on/msword"
filefield="fileUpload"
destination="e:\wwwroot\cm is\cmisfil es\securit y\upload\"
result="FileUploadedYes">
<cfdump var="#FileUploadedYes#">
<form method="post" enctype="multipart/form-da
Select a file:
<input type="file" name="fileUpload">
<input type="submit" value="Upload File">
</form>
<cffile action="upload"
accept = "application/pdf,applicati
filefield="fileUpload"
destination="e:\wwwroot\cm
result="FileUploadedYes">
<cfdump var="#FileUploadedYes#">
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<CFDUMP VAR="#FORM#"> C:\ColdFusion11\cfusion\ru ntime\work \Catalina\ localhost\ tmp\neotmp 6530038827 429928089. tmp
Yet, the file does not exist in that location.
So, I need to dig in some more and provide greater detail. Will do tomorrow. Thanks.
Yet, the file does not exist in that location.
So, I need to dig in some more and provide greater detail. Will do tomorrow. Thanks.
That's just a temporary location where files are stored before cffile upload is executed. To find out where the file was uploaded, dump your cffile result attribute instead. CFFile returns a structure with a bunch of variables, such as serverFile, serverDirectory, etcetera.
<!--- do the upload --->
<cffile action="upload" .... result="FileUploadedYes">
<!--- dump the results --->
<cfdump var="#FileUploadedYes#">
<!--- do the upload --->
<cffile action="upload" .... result="FileUploadedYes">
<!--- dump the results --->
<cfdump var="#FileUploadedYes#">
ASKER
Quick and clear answer. Follow up assistance helped too.
Thank you!
Thank you!
What you are showing should work, but I suspect it is not your actual code..