Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes struts2 upload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts2 upload" Watch "struts2 upload" New topic
Author

struts2 upload

Rajamanickam Palani
Greenhorn

Joined: Mar 01, 2013
Posts: 6
Hi Friends,

How can i upload a file through javascript please help me.
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Hello Rajamanickam Palani ,

You want to upload file via pure javascript or via struts2 ?

For struts2 , you can use the file filed in the struts form tag



On the action side



If you want to mix in Javascript with it , then you can call bind the form submit button with java script and fire an ajax request to upload the file to the server.


Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
 
Don't get me started about those stupid light bulbs.
 
subject: struts2 upload
 
Similar Threads
uploading
File OutPut
Have just Uploaded Part 2 Assignment, what to do next ?
copying file from client system to and storing in server
calling getInputStream after getParameter