Solved

how to create a file upload JSP using Apache Commons jar files?

Posted on 2011-09-22
23
2,661 Views
Last Modified: 2013-12-11
Hi ,

I have come across Apache Commons file upload utility, which I want to follow.I came across a website(www.developershome.com/wap/wapUpload/wap_upload.asp?page=jsp ) that mentioned about this, so I went ahead and downloaded the Apache commons file upload library and the io library.Added jars to my web-inf/lid folder.
  However , unable to take it forward since then.Please help how I can get this done via single JSP.

Thanks.
0
Comment
Question by:Gopal2
  • 12
  • 11
23 Comments
 
LVL 27

Expert Comment

by:rrz
Comment Utility
Please try this page. Put  commons-fileupload-1.2.1.jar in your classpath. Files will be uploaded to your web app's root folder.
<%@ page import="java.util.*,
                 java.io.*,
                 org.apache.commons.fileupload.*,
                 org.apache.commons.fileupload.servlet.*,
                 org.apache.commons.fileupload.disk.*,
                 org.apache.commons.fileupload.util.*"%>
<html><body>
            <form enctype='multipart/form-data' method="post">
                   <input type='file' name='file1'/>
                   <input type='file' name='file2'/>
                   <input type='file' name='file3'/>
                   <input type="text" name="message" value="type your message" />
                   <input Type='submit' value='Submit'/>
            </form>
<%
  boolean isMultipart = ServletFileUpload.isMultipartContent(request);
  if(isMultipart){
                  ServletFileUpload upload = new ServletFileUpload();
                  FileItemIterator iter = upload.getItemIterator(request);
                  FileItemStream item = null;
                  String name = "";
                  InputStream stream = null;
                  while (iter.hasNext()){
                                         item = iter.next();
                                         name = item.getFieldName();
                                         stream = item.openStream();
                    if(item.isFormField()){out.println("Form field " + name + ": " 
                                               + Streams.asString(stream) + "<br/>");}
                    else {
                          name = item.getName();
                          if(name != null && !"".equals(name)){
                             String fileName = new File(item.getName()).getName();
                             out.println("Client file: " + item.getName() + " <br/>with file name "
                                                        + fileName + " was uploaded.<br/>");
                             
                             File file = new File(application.getRealPath("/" 
                                                       + fileName));
                             FileOutputStream fos = new FileOutputStream(file);
                             long fileSize = Streams.copy(stream, fos, true);
                             out.print("Size was " + fileSize + " bytes <br/>");
                          }
                       }
                  }
  }
%>
</body></html>

Open in new window

0
 

Author Comment

by:Gopal2
Comment Utility
Hi,

  Thank you for your solution.I am trying to run this JSP.However, I noticed one thing. This particular functionality comes as part of a bigger form, with several other form fields.I cannot use form submit right here.Because, form submit happens with rest of the form .I need to use this as a single re-useable component , with out it's own submit action.

When the submit action happens on the over all form, it gets re-directed to another JSP, not in our control.

Is there a solution for this scenario?

Thanks and regards.
_________________________________________________________________

Also, when I run this code, though I don't see compile error, I am getting runtime errors as :

Error Message:JSPG0049E: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp failed to compile : JSPG0091E: An error occurred at line: 19 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 80 : FileItemIterator cannot be resolved to a typeJSPG0091E: An error occurred at line: 19 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 80 : The method getItemIterator(HttpServletRequest) is undefined for the type ServletFileUploadJSPG0091E: An error occurred at line: 20 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 81 : FileItemStream cannot be resolved to a typeJSPG0091E: An error occurred at line: 28 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 89 : Streams cannot be resolvedJSPG0091E: An error occurred at line: 39 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 100 : Streams cannot be resolved
Root Cause:com.ibm.ws.jsp.JspCoreException: JSPG0049E: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp failed to compile : JSPG0091E: An error occurred at line: 19 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 80 : FileItemIterator cannot be resolved to a typeJSPG0091E: An error occurred at line: 19 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 80 : The method getItemIterator(HttpServletRequest) is undefined for the type ServletFileUploadJSPG0091E: An error occurred at line: 20 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 81 : FileItemStream cannot be resolved to a typeJSPG0091E: An error occurred at line: 28 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 89 : Streams cannot be resolvedJSPG0091E: An error occurred at line: 39 in the file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jspJSPG0093E: Generated servlet error from file: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp \wp_profile\temp\LFOLR\WebSphere_Portal\FileUpLoadEAR\FileUpLoad.war\_FileUpLoad\jsp\html\_FileUpLoadPortletView.java : 100 : Streams cannot be resolved      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:571)      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper._checkForTranslation(AbstractJSPExtensionServletWrapper.java:444)      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.checkForTranslation(AbstractJSPExtensionServletWrapper.java:306)      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:148)      at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:295)      at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:648)      at com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:98)      at com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:230)      at com.ibm.fileupload.FileUpLoadPortlet.doView(FileUpLoadPortlet.java:33)      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)      at javax.portlet.GenericPortlet.render(GenericPortlet.java:233)      at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:128)      at com.ibm.wps.propertybroker.standard.filter.C2APortletFilter.doFilter(C2APortletFilter.java:183)      at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:120)      at com.ibm.ws.portletcontainer.invoker.impl.PortletServlet.doDispatch(PortletServlet.java:573)      at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:114)      at com.ibm.isclite.container.collaborator.PortletServletCollaborator.doRender(PortletServletCollaborator.java:69)      at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:105)      at com.ibm.ws.portletcontainer.rrd.RRDServerPortletServletCollaborator.doRender(RRDServerPortletServletCollaborator.java:123)      at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:105)      at com.ibm.ws.portletcontainer.cache.CacheCollaborator.doRender(CacheCollaborator.java:92)      at com.ibm.ws.portletcontainer.invoker.impl.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:105)      at com.ibm.wps.pe.pc.waspc.core.impl.PortletServletCollaboratorImpl.doRender(PortletServletCollaboratorImpl.java:156)
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
For testing, did you try copying and pasting my page as I posted it ?  
>Is there a solution for this scenario?  
For file upload, the encoded type multipart/form-data.  If you have other parameters sent with the file, then they must be parsed as a formfield. I demonstrated this in my code with the 'message'  text input element.  
>Error Message:JSPG0049E: /_FileUpLoad/jsp/html/FileUpLoadPortletView.jsp failed to compile :
...
>FileItemIterator cannot be resolved to a typeJSPG0091E:  
You need to have the
commons-fileupload-1.2.1.jar    (This is the latest version.)
in your classpath. I would assume that should be your web app's WEB-INF/lib folder.
0
 

Author Comment

by:Gopal2
Comment Utility
Hi,

 I later realized I need to make WAS configuration under Environment > Shared Libraries and added them under server's classloader too. Once that done and server restarted, the error went away.
Just having in project's java build path wasn't enough.

  However, when I run this JSP on server, I have no errors coming up.When I try browsing the files and pick 3 files and click on submit button, I don't see anything happening. I have no clue where the file is saved .Where to look for it.

    Can you please tell me where the files are getting saved?

I understand that by not having form action value given, the control comes back to this form upon submit.So, I tried placing debug statements in the  java scriptlet code following the form.But don't see them in log, meaning the control is not coming to that scriptlet?

Thank you.
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
>I later realized I need to make WAS configuration
I don't use WAS. So, I can't help you with that.
>Can you please tell me where the files are getting saved?  
Please add this line
out.print("File Path is " + file.getPath());
to my code after line 40.  
But, if you running your web app from a war file, then you might want to change file path. Change  
>File file = new File(application.getRealPath("/"  + fileName));  
to  
File file = new File("absolute/path/to/folder/where/you/want/file/"  + fileName);  
>I understand that by not having form action value given  
You asked in your question;
>Please help how I can get this done via single JSP.
That is why I did it that way. You can separate my code into two pages. The first page could have the form. The second page could be called in the action of the form.
>But don't see them in log, meaning the control is not coming to that scriptlet?
I see that you are in a Portlet environment. I don't work with Portlets.
You have have to use full URLs.
Put the following line
out.print("Requested URL is " + request.getRequestURL());  
Does that print the URL you used to get to the page ?

0
 

Author Comment

by:Gopal2
Comment Utility
Yes rrz@871311. I want it as only a single JSP solution.

And now I placed the code you mentioned :
out.print("File Path is " + file.getPath());
File file = new File("absolute/path/to/folder/where/you/want/file/"  + fileName);
out.print("Requested URL is " + request.getRequestURL());  
Does that print the URL you used to get to the page ? Answer is no.
None of the out.println s are showing up on the jsp. And absolutely no console log either.

I created a file path for the directory where the files need to be uploaded, and placed in this line as:
File file = new File("C:\filerepo"  + fileName);

One clarification.Though this is done as part of portlet development, for every practical reason, this is just a JSP, no more.

Thanks.



0
 

Author Comment

by:Gopal2
Comment Utility
Hi,

 I added few more lines of code for debugging, and see that the boolean "isMuliPart" is coming out as "false" upon file upload submit .That is why the relevant conditional code is not getting executed.
Please take a look at the jsp code attached.

Thanks.

PS: I also added the factory.setRepository(new File("c:\\filerepo")); for explicitly declaring the location to where the files need to be uploaded.
fileupload.txt
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
>"isMuliPart" is coming out as "false"  
This is mystery, because the encoding type of your form is multipart/form-data.
Please browse to your  fileupload.jsp and look at the page source that was sent to your browser by your server.
Does the source code for the form have
<form enctype='multipart/form-data' method="post">  
?  
>PS: I also added the factory.setRepository(new File("c:\\filerepo"));  
You have the wrong idea.  That method sets the directory used to temporarily store files that are larger than the configured size threshold.  That is used with the older API(DiskFileItemFactory). But the streaming API that I have used does not need to store the data. The data is streamed directly to where you want to upload it.  
>None of the out.println s are showing up on the jsp.  
Please put the following lines at the top of the scriptlet(outside of the if block)
out.print("App Path is " + application.getRealPath("/") + "<br/>");
out.print("Requested URL is " + request.getRequestURL());  
0
 

Author Comment

by:Gopal2
Comment Utility
I re-ran the jsp with the changes you suggested, and the results are as follows:

Please browse to your  fileupload.jsp and look at the page source that was sent to your browser by your server.Does the source code for the form have
<form enctype='multipart/form-data' method="post">  
?    ----- Yes

Still, "isMuliPart" is coming out as "false"

Okay, removed the   code line :
factory.setRepository(new File("c:\\filerepo"));

For the following statements, I get the following results:

out.print("App Path is " + application.getRealPath("/") + "<br/>");
------- the absolute filepath to this jsp(up until WebContent folder)

out.print("Requested URL is " + request.getRequestURL());
------------- NULL.

Thanks.


0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
>Still, "isMuliPart" is coming out as "false"  
Are you saying that is the case after you select a file and click on the form's submit button ?  
>------------- NULL.
I don't why that happens. Maybe the following will work.
out.print("Requested URL is " + request.getRequestURL().toString());  
>------- the absolute filepath to this jsp(up until WebContent folder)  
I don't understand. What are you saying ? Does it give a path or not ?  

I don't know why you are having these problems. Hopefully there is an expert listening to this who can help.
0
 

Author Comment

by:Gopal2
Comment Utility
Sorry rrz@871311, I couldn't get back to this .

Are you saying that is the case after you select a file and click on the form's submit button ?
-Yes . After selecting the txt file to upload,
 and submitting this form, then I am getting isMultiPart = false.

out.print("Requested URL is " + request.getRequestURL().toString());  
>------- the absolute filepath to this jsp(up until WebContent folder)  
I don't understand. What are you saying ? Does it give a path or not ?
- Yes, it is giving path to my jsp.

The issue still is perplexing is why the " isMuliPart " value is coming as "false".

I am still working on this.
If any one can give some direction as to how to analyse this issue,  I will be thankful.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 27

Expert Comment

by:rrz
Comment Utility
>The issue still is perplexing is why the " isMuliPart " value is coming as "false".  
Is it because you are misspelling the variable "isMultipart" ?
If that is not it, then try a different browser.  

Did you copy and paste my code as is ? It works for me.
0
 

Author Comment

by:Gopal2
Comment Utility
Yes. I used the same exact code . But since isMultipart = false, (after I click the submit button)it is not entering the if conditional block at all.
That is a major issue for me.

Wondering if the form submission and processing happening on the same page is causing the issue?
But you are saying that it works for you.

I tried setting the isMultipart=true just to force the control to get inside the if block.But it gives this error :
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null

So basically the request content type header is coming as null. Do not know why.

Thanks .
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
>Wondering if the form submission and processing happening on the same page is causing the issue?
No.
>Yes. I used the same exact code . But since isMultipart = false, (after I click the submit button)  
Did you select a file and send it ?
Please add these lines to the start of your scriptlet.
out.print("Request content length is " + request.getContentLength() + "<br/>");
out.print("Request content type is " + request.getHeader("Content-Type") + "<br/>");
What is output initially ?
What is the output when you send a file ? It should a little bigger than the file size ?
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
>What is the output when you send a file ? It should a little bigger than the file size ?
I meant
The content length should be a little bigger than the file size.
0
 

Author Comment

by:Gopal2
Comment Utility
Hi rrz@871311,

  We are having some network issues at work today.So I couldn't work on it.Will try what you said tomorrow and update you.Meanwhile, so far as I remember for request.getHeader("Content-Type"),
it was giving the value as "null" both before and after file upload.

Thanks.
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
For our test, let's break it down to the bare bones. Please use the following JSP.  
Request content type is <%=request.getHeader("Content-Type")%>
<html>
<body>
<form enctype="multipart/form-data" method="post">
<input type='file' name='file1'/>
<input type="submit" />
</form>
</body>
</html>

Open in new window


When I first browse to that page, the response is  
Request content type is null  
When I click on the submit button(with or without selecting a file), the response is  
Request content type is multipart/form-data; boundary=---------------------------7db1861da02a0
If I change  
<form enctype="multipart/form-data" method="post">
to  
<form enctype="zzzzzzzzmultipart/form-data" method="post">
and get the server to reload the page and I click on the submit button, then the response is
Request content type is application/x-www-form-urlencoded  
If I change
<form enctype="multipart/form-data" method="post">
to
<form enctype="multipart/form-data" method="get">
and get the server to reload the page and I click on the submit button, then the response is
Request content type is null  



0
 

Author Comment

by:Gopal2
Comment Utility
Very surprising !
I ran the same code you ran .And I got the same results.So I built the earlier JSP you gave me ,
With the statement :Request content type is <%=request.getHeader("Content-Type")%>
in the beginning of the form. And that displays there is value to it :
Request content type is multipart/form-data; boundary=---------------------------7db2e824f11ce
 However, the issue still remains the same with our JSP code:
<%
  boolean isMultipart = ServletFileUpload.isMultipartContent(request);
  if(isMultipart){
                             blah...
                                 }
 I get the following console log :
 org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null
      at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:908)
_________________________________________________________________
Very confusing .

Thanks.
0
 
LVL 27

Expert Comment

by:rrz
Comment Utility
It is a mystery.
Did you check the content length as I suggested above here? Are the file bytes being sent ?
0
 

Author Comment

by:Gopal2
Comment Utility
Hi rrz@871311,

  Again, I got on this project only today after that. So please excuse me for being unresponsive all these days.
Now , I see that based on the number of files uploaded, the content lenth is changing as below.However, at all times the boolean isMultipart () is evaluating to false only.
Any more suggestions?

Thanks.


_______________________________________________________
with no files/no text message, but with rest of the form fields filled in:
(minimum length)

--------inside the file upload code block------------
Request content length is 1606
Request content type is application/x-www-form-urlencoded
-----boolean isMultipart =false
/////////// --------//--//--//--//--//--//--//---------
_________________________________________________________
with no files selected for upload,the text field (from your code) and several other form fields are filled in:
Request content length is 1662
Request content type is application/x-www-form-urlencoded
-----boolean isMultipart =false
_____________________________________________________________
with a file (507 bytes size):
--------inside the file upload code block------------
Request content length is 1756
Request content type is application/x-www-form-urlencoded
-----boolean isMultipart =false
/////////// --------//--//--//--//--//--//--//---------
/////////// --------//--//--//--//--//--//--//---------
_________________________________________________________
with 2 files(each 507 bytes):
--------inside the file upload code block------------
Request content length is 1830
Request content type is application/x-www-form-urlencoded
-----boolean isMultipart =false
/////////// --------//--//--//--//--//--//--//---------
__________________________________________________________
with 3 files(each 507 bytes):
--------inside the file upload code block------------
Request content length is 1925
Request content type is application/x-www-form-urlencoded
-----boolean isMultipart =false
/////////// --------//--//--//--//--//--//--//---------
__________________________________________________________
0
 

Author Comment

by:Gopal2
Comment Utility
Hi,

  I finally got to see boolean isMultipart =true , when I collect the reponse from the next page, not on the same jsp page.
and get this from request :

--------inside the file upload code block------------
Request content length is 5329
Request content type is multipart/form-data; boundary=---------------------------7db9c3610a5c
-----boolean isMultipart =true
--------inside the file upload if(isMultipart)//--//--//--//--//--//--//
Form field Language: English
Form field firstName: jhasgjgjaf
Form field lastName: jhasgjgjaf
Form field jobTitle:
Form field companyName: jhasgjgjaf
Form field country: BB
Form field State: Required
Form field Province: Required
Form field address1: jhasgjgjaf
Form field address2:
Form field city: jhasgjgjaf
Form field zipcode: jhasgjgjaf
Form field phoneNumber:
Form field email: jhasgjgjaf@aol.com

--------inside the file upload if(isMultipart)//ELSE//--//--//--//--//--//
Client file: C:\Documents and Settings\Aug1-5.txt
with file name C:\Documents and Settings\Aug1-5.txt was uploaded.
Size was 507 bytes
Form field message: type your message
Form field btnSub:
Form field contents: firstName: jhasgjgjaf lastName: jhasgjgjaf jobTitle: companyName: jhasgjgjaf country: BB State: Required Province: Required address1: jhasgjgjaf address2: city: jhasgjgjaf zipcode: jhasgjgjaf phoneNumber: email: jhasgjgjaf@aol.com
///////////
_____________________________

This looks promising.
Let me move on to next step:
To get the file into DB.
If I don't see any issues , I will close this question.

Thanks.
0
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
Comment Utility
>I finally got to see boolean isMultipart =true , when I collect the reponse from the next page, not on the same jsp page.  
I am glad that you finally got it to work. I don't know why it wouldn't work from same page(it did for me).
0
 

Author Closing Comment

by:Gopal2
Comment Utility
Thanks for all the help.The fact that the boolean isMultipart =true isn't coming up on the same page has created other issues, due to which we had to place this project on back burner for now.

Will keep this shelved until then. Thanks a lot for all those who helped me.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now