ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 21st, 2005, 04:37 PM
mikemac mikemac is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Greenville NC
Posts: 70 mikemac User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 15 m 24 sec
Reputation Power: 4
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????

Reply With Quote
  #2  
Old January 22nd, 2005, 04:51 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,655 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 13 h 29 m 8 sec
Reputation Power: 53
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

Reply With Quote
  #3  
Old January 24th, 2005, 11:57 AM
glively glively is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 17 glively User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 51 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Upload nightmares


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway