This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts 1.2.4 File Upload - Form File is null in action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 1.2.4 File Upload - Form File is null in action" Watch "Struts 1.2.4 File Upload - Form File is null in action" New topic
Author

Struts 1.2.4 File Upload - Form File is null in action

C Dow
Greenhorn

Joined: Feb 22, 2010
Posts: 2
I'm using struts 1.2.4, running my app on WLS 10.3. I've used file upload millions of times in the past and it's been as simple as the struts example. But this latest piece of code I'm working on, when it's gets to the action the form file is null. I check to see if the request is Multipart and it is. The other field on the form has data, but the form file field is empty. Does anyone have a clue what I could be doing wrong? I'm adding the code below.

FORM CLASS



ACTION CLASS


JSP PAGE


STRUTS-CONFIG


If you have any suggestions, please let me know
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617


C Dow
Greenhorn

Joined: Feb 22, 2010
Posts: 2
Thanks so much. I just discovered that I was calling setFormFile vs. setFile in my Action Form. Was completely overlooking that for 2 days.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No problem, and welcome to JavaRanch!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 1.2.4 File Upload - Form File is null in action
 
Similar Threads
struts file upload problem
Map the action form object
File upload with websphere 6. file object is stripped.
FreeMarker template error
Using FormFile in struts