...
Package: org.openhubframework.openhub.extension.fileupload
Route | UploadFileRoute |
IN/OUT | IN |
URL | .../http/upload |
Description | File is uploaded via PUT HTTP method. Input file is uploaded to temporary directory with unique file identifier (fileId) that is returned back. When this fileId comes with other data then the file is moved and renamed to right target folder. Uploading files can be tested with curl command tool:
Code Block |
---|
curl -i -X PUT -T "/Volumes/Obelix/context.xml" http://localhost:8080/esb/http/... |
|
Configuration |
Parameter | Default value | Description |
---|
file.maxUploadedFileSize | 5000 | Maximum size (in kB) for uploaded files | file.upload.servletName | CamelServlet | Servlet name defined in web.xml for uploading files |
web.xml: Code Block |
---|
<!-- Camel servlet-->
<servlet>
<servlet-name>CamelServlet</servlet-name>
<servlet-class>org.apache.camel.component.servlet.CamelHttpTransportServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CamelServlet</servlet-name>
<url-pattern>/http/*</url-pattern>
</servlet-mapping> |
|
Error codes | See ErrorFileUploadEnum Error code | Description |
---|
E100 | it's possible to use HTTP PUT method only | E101 | uploaded file exceeded maximum possible size |
|
Prerequisites | File upload uses FileRepository contract and therefore it's necessary to inicialize FileRepository's implementations. Code Block |
---|
<bean id="fileRepository" class="org.openhubframework.openhub.core.common.file.DefaultFileRepository"/> |
DefaultFileRepository uses ohf.dir.temp and ohf.dir.fileRepository configuration properties, see Configuration page for more details. |
Notes | |