|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Upload nightmares
When I allow users to upload test images I get this error:
The form field "/opt/coldfusionmx/runtime/servers/default/SERVER-INF/temp/wwwroot-tmp/neotmp63487.tmp" did not contain a file. The error occurred on line 71. <!---------------------------------------------------> Here is the code for that <CFFILE>: <!---if user said yes to include images and the filefield is not empty upload now---> <cfif SESSION.TestWiz.ImagesYN eq "Yes" and #FORM['QuestionIMG' & quesNum]# neq ""> <CFLOCK name="#This.Lock#" timeout="10" throwontimeout="yes" type="exclusive"> <CFFILE action="upload" destination="#ExpandPath("QuestImages")#" nameconflict="makeunique" filefield="#FORM['QuestionIMG' & quesNum]#" mode="777"> <!---now insert that image---> <!---LINE 71---> <cfquery datasource="#REQUEST.db#"> INSERT INTO Images(Name,TestID,Type,Ext) VALUES('#FILE.ServerFile#',#NewTest.TestID#,1,'#FILE.ClientFileExt#') </cfquery> .......and so on <!----------------------------------------------------> and when I view the source code to confirm the formfield name and existence here is what the form field looks like: <cfform method="post" action="test3.cfm" enctype="multipart/form-data"> <input type="file" name="QuestionIMG1" > ------------------------------------------- What could cause this error when there is a file in that field???? |
|
#2
|
|||
|
|||
|
I don't think you need to specify the FORM scope in the fileField attribute, nor do I think this can be a variable. I think it just wants the name of the field. See what happens if you try this:
filefield="QuestionIMG#quesNum#"
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
I use the "form.fieldname" on all of my file uploads and it works fine. I suspect it has something to do with your dynamic field name not being properly resolved.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Upload nightmares |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|