|
Hi All,
Using Struts2 and need to know how to upload multiple files using single <s:file> tag. I need a file upload functionality similar to gmail(Google Email). Please advice how to do this even using other frameworks along with Struts2. Thanks in advance. Regards, Sharath. |
|
Check out the Struts 2 showcase example for uploading files.
Best, Muneer On Fri, Apr 6, 2012 at 12:36 PM, sharath karnati <[hidden email]> wrote: > Hi All, > > Using Struts2 and need to know how to upload multiple files using > single <s:file> tag. I need a file upload functionality similar to > gmail(Google Email). > > Please advice how to do this even using other frameworks along with > Struts2. > > Thanks in advance. > > Regards, > Sharath. > -- Confidentiality Notice ------------------------------- THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. IF YOU ARE NOT THE INTENDED RECIPIENT, OR THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS MESSAGE TO THE INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION OR COPYING OF THE COMMUNICATION IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY IMMEDIATELY AT [hidden email] OR BY TELEPHONE AT 817-458-1764. THANK YOU. |
|
It is using multiple <s:file> tags. I need a single <s:file> and need to upload multiple files.
--- On Fri, 4/6/12, Muneer Malik <[hidden email]> wrote: From: Muneer Malik <[hidden email]> Subject: Re: Uploading multiple files using single <s:file> tag. To: "Struts Users Mailing List" <[hidden email]> Cc: "sharath karnati" <[hidden email]>, [hidden email] Date: Friday, April 6, 2012, 1:40 PM Check out the Struts 2 showcase example for uploading files. Best,Muneer On Fri, Apr 6, 2012 at 12:36 PM, sharath karnati <[hidden email]> wrote: Hi All, Using Struts2 and need to know how to upload multiple files using single <s:file> tag. I need a file upload functionality similar to gmail(Google Email). Please advice how to do this even using other frameworks along with Struts2. Thanks in advance. Regards, Sharath. -- Confidentiality Notice ------------------------------- THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE UNDER APPLICABLE LAW. IF YOU ARE NOT THE INTENDED RECIPIENT, OR THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS MESSAGE TO THE INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION OR COPYING OF THE COMMUNICATION IS STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY IMMEDIATELY AT [hidden email] OR BY TELEPHONE AT 817-458-1764. THANK YOU. |
|
Sharath,
You need to use tools like Uploadify for this to work. I am using Uploadify with struts2 it works perfectly fine to me. Thanks Jay On Fri, Apr 6, 2012 at 11:42 AM, sharath karnati <[hidden email]> wrote: > It is using multiple <s:file> tags. I need a single <s:file> and need to > upload multiple files. > > --- On Fri, 4/6/12, Muneer Malik <[hidden email]> wrote: > > From: Muneer Malik <[hidden email]> > Subject: Re: Uploading multiple files using single <s:file> tag. > To: "Struts Users Mailing List" <[hidden email]> > Cc: "sharath karnati" <[hidden email]>, [hidden email] > Date: Friday, April 6, 2012, 1:40 PM > > Check out the Struts 2 showcase example for uploading files. > Best,Muneer > > On Fri, Apr 6, 2012 at 12:36 PM, sharath karnati <[hidden email]> > wrote: > > Hi All, > > > > Using Struts2 and need to know how to upload multiple files using > single <s:file> tag. I need a file upload functionality similar to > gmail(Google Email). > > > > Please advice how to do this even using other frameworks along with > Struts2. > > > > Thanks in advance. > > > > Regards, > > Sharath. > > > > > -- > Confidentiality Notice > ------------------------------- > > > THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY > CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM > DISCLOSURE UNDER APPLICABLE LAW. IF YOU ARE NOT THE INTENDED RECIPIENT, OR > THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS MESSAGE TO THE > INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, > DISTRIBUTION OR COPYING OF THE COMMUNICATION IS STRICTLY PROHIBITED. IF > YOU HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY IMMEDIATELY AT > [hidden email] OR BY TELEPHONE AT 817-458-1764. > > > > THANK YOU. > > > |
|
Hi Jay,
Checked "Uploadify" and it requires swfObject & Flash Player, in our application we don't use these...so can you please provide me any other solution you have for this... Thanks, Sharath. --- On Fri, 4/6/12, jayakumar ala <[hidden email]> wrote: From: jayakumar ala <[hidden email]> Subject: Re: Uploading multiple files using single <s:file> tag. To: "Struts Users Mailing List" <[hidden email]> Date: Friday, April 6, 2012, 3:05 PM Sharath, You need to use tools like Uploadify for this to work. I am using Uploadify with struts2 it works perfectly fine to me. Thanks Jay On Fri, Apr 6, 2012 at 11:42 AM, sharath karnati <[hidden email]> wrote: > It is using multiple <s:file> tags. I need a single <s:file> and need to > upload multiple files. > > --- On Fri, 4/6/12, Muneer Malik <[hidden email]> wrote: > > From: Muneer Malik <[hidden email]> > Subject: Re: Uploading multiple files using single <s:file> tag. > To: "Struts Users Mailing List" <[hidden email]> > Cc: "sharath karnati" <[hidden email]>, [hidden email] > Date: Friday, April 6, 2012, 1:40 PM > > Check out the Struts 2 showcase example for uploading files. > Best,Muneer > > On Fri, Apr 6, 2012 at 12:36 PM, sharath karnati <[hidden email]> > wrote: > > Hi All, > > > > Using Struts2 and need to know how to upload multiple files using > single <s:file> tag. I need a file upload functionality similar to > gmail(Google Email). > > > > Please advice how to do this even using other frameworks along with > Struts2. > > > > Thanks in advance. > > > > Regards, > > Sharath. > > > > > -- > Confidentiality Notice > ------------------------------- > > > THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY > CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM > DISCLOSURE UNDER APPLICABLE LAW. IF YOU ARE NOT THE INTENDED RECIPIENT, OR > THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS MESSAGE TO THE > INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY DISSEMINATION, > DISTRIBUTION OR COPYING OF THE COMMUNICATION IS STRICTLY PROHIBITED. IF > YOU HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY IMMEDIATELY AT > [hidden email] OR BY TELEPHONE AT 817-458-1764. > > > > THANK YOU. > > > |
|
This post has NOT been accepted by the mailing list yet.
can u provide any link to show how to use it.
Thanks |
|
This post has NOT been accepted by the mailing list yet.
In reply to this post by sharath
I have created gmail like attachment using java script in jsp page. But in action class only one attached file is showing...
My jsp page is : *Media file upload : | <s:file name="attachmentMedia" id="attachmentMedia" onchange="document.getElementById('moreUploadsMediaLink').style.display = 'block';" /> <div id="moreUploadsMedia"></div> <div id="moreUploadsMediaLink" style="display: none;" > | <a href="javascript:addMediaFileInput(3);">Attach another media File </div> My Java Script is : var uploadedMediaNumber = 2; var uploadedImageNumber = 2; function addMediaFileInput(maxNumber) { if (uploadedMediaNumber > maxNumber) { alert("Sorry! You can only upload " + maxNumber + " media files only"); } else { //alert("uploaded media number "+uploadedMediaNumber); var d = document.createElement("div"); var l = document.createElement("a"); var file = document.createElement("input"); file.setAttribute("type", "file"); file.setAttribute("name", "attachment" + uploadedMediaNumber); l.setAttribute("href", "javascript:removeMediaFileInput('f" + uploadedMediaNumber + "');"); l.appendChild(document.createTextNode("remove")); d.setAttribute("id", "f" + uploadedMediaNumber); d.appendChild(file); d.appendChild(l); document.getElementById("moreUploadsMedia").appendChild(d); uploadedMediaNumber++; } } And my action class is : public class AdditionalInfoAction extends ActionSupport implements ServletRequestAware { /** * */ Logger logger = Logger.getLogger(AdditionalInfoAction.class); private static final long serialVersionUID = 1L; private HttpServletRequest servletRequest; private String[] qrCodePaths; private String additionalComment; private List<File> attachmentMedia =new ArrayList<File>(); private List<File> attachmentImage =new ArrayList<File>(); private List<String> attachmentMediaContentType =new ArrayList<String>(); private List<String> attachmentMediaFileName =new ArrayList<String>(); with their getters and setters. I want to store the entered file path into database. But I am unable to access all the attached file. |
| Powered by Nabble | Edit this page |
