<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to post a file to a start ivp "Requests Start"</title><link>https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-start</link><description>&lt;p&gt;Hello,
 I have an example JSP page:
&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;File Upload Form&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
This form allows you to upload a file to the server.&amp;lt;br&amp;gt;
&amp;lt;form action="&lt;a href='http://localhost:8081/ivy/pro/designer/HREventManager_ivy/150FEF18A5DB6168/start3.ivp"'&gt;http://localhost:8081/ivy/pro/designer/HREventManager_ivy/150FEF18A5DB6168/start3.ivp"&lt;/a&gt; method="post" enctype="multipart/form-data"&amp;gt;&amp;lt;br&amp;gt;
Type (or select) Filename: &amp;lt;input type="file" name="uploadFile"&amp;gt;
&amp;lt;input type="submit" value="Upload File"&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In the start3.ivp page, I have the java code to check the file stream:
&lt;/p&gt;&lt;pre&gt;&lt;code&gt;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));
}     &lt;br&gt;
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());&lt;p&gt;&lt;/p&gt;
&lt;p&gt;ivy.log.info("part="+o.getParts());&lt;/p&gt;
&lt;/code&gt;&lt;p&gt;&lt;code&gt;ivy.log.info(o.getMethod());
&lt;/code&gt;&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When run the form,I see nothing in the log about o.getParts. Here is the full output:
&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
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
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I use:
Xpert.ivy Designer
Version: 5.0.11 (Rothorn) 
Revision: 45786
Build date: May 14, 2014&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-start" rel="self"></atom:link><language>en</language><lastBuildDate>Wed, 18 Nov 2015 09:32:36 -0500</lastBuildDate><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-start/1562</link><description>&lt;p&gt;On the process start use a parameter called &lt;code&gt;uploadFile&lt;/code&gt; of type File (ch.ivyteam.ivy.scripting.objects.File):
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/file.png"&gt;&lt;/p&gt;
&lt;p&gt;The file will then be uploaded to Axon.ivy and can be accessed using the process data attribute &lt;code&gt;in.uploadFile&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;String content = in.uploadFile.read();
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Wed, 18 Nov 2015 09:32:36 -0500</pubDate><guid>https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-start/1562</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-start/1560</link><description>&lt;p&gt;I'd use the well documented JSF approach to upload files instead of JSP. &lt;/p&gt;
&lt;p&gt;See the HtmlDialogDemos project in your Designer/applications/samples/ directory.
Within there is a demo how to upload a file with an Hmtl User Dialg (JSF): see /FileUploadSimpleModeDemo.ivp&lt;/p&gt;
&lt;p&gt;If you are trying to start a dedicated new case if a file was pushed to the server, you can either start a new case with a trigger activity or use the file pickup start event bean.&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/filePickupStartEvent.png"&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Mon, 16 Nov 2015 15:13:39 -0500</pubDate><guid>https://answers.axonivy.com/questions/1559/how-to-post-a-file-to-a-start-ivp-requests-start/1560</guid></item></channel></rss>