Hello, I have an example JSP page:


<html>
<head>
<title>File Upload Form</title>
</head>
<body>
This form allows you to upload a file to the server.<br>
<form action="http://localhost:8081/ivy/pro/designer/HREventManager_ivy/150FEF18A5DB6168/start3.ivp" method="post" enctype="multipart/form-data"><br>
Type (or select) Filename: <input type="file" name="uploadFile">
<input type="submit" value="Upload File">
</form>
</body>
</html>

In the start3.ivp page, I have the java code to check the file stream:

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));
}     
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());

ivy.log.info("part="+o.getParts());

ivy.log.info(o.getMethod());

When run the form,I see nothing in the log about o.getParts. Here is the full output:


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

I use: Xpert.ivy Designer Version: 5.0.11 (Rothorn) Revision: 45786 Build date: May 14, 2014

asked 16.11.2015 at 05:07

NhutNguyen's gravatar image

NhutNguyen
(suspended)
accept rate: 0%


On the process start use a parameter called uploadFile of type File (ch.ivyteam.ivy.scripting.objects.File): alt text

The file will then be uploaded to Axon.ivy and can be accessed using the process data attribute in.uploadFile:

String content = in.uploadFile.read();
link

answered 18.11.2015 at 09:32

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

I'd use the well documented JSF approach to upload files instead of JSP.

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

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.alt text

link

answered 16.11.2015 at 15:13

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

edited 16.11.2015 at 15:17

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7

Asked: 16.11.2015 at 05:07

Seen: 3,498 times

Last updated: 18.11.2015 at 09:32