File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

uploading multi images by using file upload...

 
anilkumar Gannavarapu
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am tring to upload multiple images by using struts.


Form bean:
===========
public class XMLActionForm extends ActionForm
{
private FormFile myXMLFile;
private String imagedesc;
private String cost ;
private String size;
private String imageName;
private String available;







public String getImagedesc() {
return imagedesc;
}

public void setImagedesc(String imagedesc) {
this.imagedesc = imagedesc;
}

public String getSize() {
return size;
}

public void setSize(String size) {
this.size = size;
}

public void setMyXMLFile(FormFile myFile)
{
this.myXMLFile = myFile;
}

public FormFile getMyXMLFile()
{
return myXMLFile;
}

public String getImageName() {
return imageName;
}

public void setImageName(String imageName) {
this.imageName = imageName;
}

public String getAvailable() {
return available;
}

public void setAvailable(String available) {
this.available = available;
}

public String getCost() {
return cost;
}

public void setCost(String cost) {
this.cost = cost;
}


Action:

FormFile xmlFile = xmlForm.getMyXMLFile();
FileOutputStream fileOut = null;

String contentType = xmlFile.getContentType();
String fileName = xmlFile.getFileName();
int fileSize = xmlFile.getFileSize();
byte[] fileData = xmlFile.getFileData();
String file = new String(fileData);

by using above code i am able to upload one file. But i not able to upload multiple images and along with image description. Please give some idea what are the changes i have to do in those files and is there any chance to call my action multiple times by using ajax.

my jsp code is:

<html:form action="/handleFileUpload" enctype="multipart/form-data">
<table>
<tr>
<td>Painting:</td><td><html:file property="myXMLFile"/> </td>
</tr>

<tr class="textbold">
<td>Description :</td>
<td valign="top" nowrap class="textnormal">
<div align="left"><html:textarea property="imagedesc"
rows="5" value="" cols="30" /></div>
</td>
</tr>
<tr class="textbold">
<td>Cost :</td>
<td valign="top" class="textnormal">
<html:text property="cost"></html:text>
</td>
</tr>
<tr class="textbold">
<td>Size :</td>
<td valign="top" class="textnormal">
<html:text property="size"></html:text>
</td>
</tr>

<tr class="textnormal">
<td>Available for Sale :</td>
<td>
<table width="30%" border="0" cellpadding="0" cellspacing="0">
<tr class="textnormal">
<td width="11%"><html:radio property="available" value="0"/></td>
<td width="21%">yes</td>
<td width="11%"><html:radio property="available" value="1"/></td>
<td width="77%" nowrap>no</td>
</tr>
</table>
</td>
</tr>
<tr><td><html:submit value="Submit"/> </td></tr>
</table>
</html:form>


awiting for your reply....
 
srinivasss pappoooo
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ra mama,

How are you?? n where are you??

nice to meet you after a long time. call me @ 91-9884609939 immediately.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic