File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes File Upload not working as expected with javascript,ajax, struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File Upload not working as expected with javascript,ajax, struts" Watch "File Upload not working as expected with javascript,ajax, struts" New topic
Author

File Upload not working as expected with javascript,ajax, struts

krishna chaitanya praturi
Greenhorn

Joined: Aug 13, 2012
Posts: 4
I have an application where I have to upload files in a dynamic table. My code is as follows:

JSP code:




JS code:




MasterBean.java:




FileUpload.java




My Problem is , This code works sometimes and does not on other times.

1.When it works.. it uploads the first file and then when I retry uploading another file , it gives the details of the first file and uploads the first file again. The second file is not getting uploaded.

2.When it does not work , It gives a null pointer exception. and getMyFile() shows null in the console.

Can anyone please let me know what is wrong with my code? and explain me exactly what is happening here?? Thank You in Advance!

note: working in eclipse galileo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File Upload not working as expected with javascript,ajax, struts
 
Similar Threads
Map the action form object
HOw to store image in struts?upload.FormFile
write the contents that we read from a file to a textbox.
File upload with websphere 6. file object is stripped.
Displaying file content in a jsp page