This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes File 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 "File upload" Watch "File upload" New topic
Author

File upload

Julie Jacob
Greenhorn

Joined: Aug 17, 2005
Posts: 20
I have an image in my mysql database,and i want to display it on a jsp using struts. how can i write code?
Here i needed to upload an image and viewign an image on JSP page


please help me

Thanks a lots
Franck Tranchant
Ranch Hand

Joined: Aug 07, 2003
Posts: 75
Hi Julie

Actually, i can see 2 questions in your post:
1- how to display a picture stored in a database from a JSP,
2- how to provide a user the way to upload a picture.

Question 1 : See previous topic "Display image from Action class". It might help.

Question 2 : What do you exactly want. Upload file and simply store it on a file server ? Upload the file then insert it in your database ?
[ August 31, 2005: Message edited by: Franck Tranchant ]

Franck<p>--------------------
Geoff Boushey
Greenhorn

Joined: Jan 21, 2005
Posts: 11
I'm not sure if I understand your question exactly... are you trying to upload a file using struts?

There's a fairly easy to understand example of file uploads in the struts-examples file included with the struts download. You'll probably have to adapt it, but it'll get you started.
vijaya bharath
Ranch Hand

Joined: Jun 10, 2005
Posts: 66
Hi,

May be it helps u
<html:file property="fileSelectionBox"/> ---> Tag creates the file upload element on the form. The property must be of the type org.apache.struts.upload.FormFile.


Regards,<br />Vijaya Bharath.<br />SCJP1.4 <br />SCWCD5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File upload
 
Similar Threads
how to upload and retrive a image from mysql database
how to upload an image through jsp
Upload image to server using JSP
image uploading in jsp
Uploading an image