Questions Tagged With fileuploadhttps://answers.axonivy.com/tags/fileupload/?type=rss&user=NhutNguyenquestions tagged <span class="tag">fileupload</span>enMon, 16 Nov 2015 05:07:28 -0500How to post a file to a start ivp "Requests Start"https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-start<p>Hello, I have an example JSP page: </p><pre><code> &lt;html&gt; &lt;head&gt; &lt;title&gt;File Upload Form&lt;/title&gt; &lt;/head&gt; &lt;body&gt; This form allows you to upload a file to the server.&lt;br&gt; &lt;form action="<a href='http://localhost:8081/ivy/pro/designer/HREventManager_ivy/150FEF18A5DB6168/start3.ivp"'>http://localhost:8081/ivy/pro/designer/HREventManager_ivy/150FEF18A5DB6168/start3.ivp"</a> method="post" enctype="multipart/form-data"&gt;&lt;br&gt; Type (or select) Filename: &lt;input type="file" name="uploadFile"&gt; &lt;input type="submit" value="Upload File"&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre><p></p> <p>In the start3.ivp page, I have the java code to check the file stream: </p><pre><code>import java.io.StringWriter; import org.apache.commons.io.IOUtils; import javax.servlet.http.Part; import ch.ivyteam.ivy.htmldialog.request.impl.HttpProcessRequest; import javax.servlet.http.HttpServletRequest; import java.util.Iterator; Iterator parameters = ivy.request.getParameterNames(); while(parameters.hasNext()){ String name = parameters.next() as String; ivy.log.error(name); ivy.log.error(ivy.request.getParameter(name).getClass()); ivy.log.error(ivy.request.getParameter(name)); } <br> HttpProcessRequest r = ivy.request as HttpProcessRequest; ivy.log.info("r="+r); HttpServletRequest o =r.getHttpServletRequest(); ivy.log.info("o="+o); ivy.log.info("content length="+o.getContentLength());<p></p> <p>ivy.log.info("part="+o.getParts());</p> </code><p><code>ivy.log.info(o.getMethod()); </code></p></pre><p></p> <p>When run the form,I see nothing in the log about o.getParts. Here is the full output: </p><pre><code> uploadFile class java.lang.String 5z.doc r=HTTP POST Start Processes/BadgeRequestProcess.mod/start3.ivp(553.553.0.0) o=org.apache.catalina.connector.RequestFacade@4c384c5a part=[] org.apache.catalina.connector.CoyoteInputStream@77da5b0a POST </code></pre><p></p> <p>I use: Xpert.ivy Designer Version: 5.0.11 (Rothorn) Revision: 45786 Build date: May 14, 2014</p>NhutNguyenMon, 16 Nov 2015 05:07:28 -0500https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-startfileupload