aspose file tools*
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 Spring in Action this week in the Spring 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!
 
wood burning stoves
 
subject: Struts 1.2.4 File Upload - Form File is null in action