Documentation
  • Introduction
  • Installation
    • Docker Container
      • Database
      • Deployment Modes
      • Docker Environment Variables
      • Deploy on AWS
      • Deploy on Digital Ocean
    • First Steps After Installation
      • Add New Application
      • Publish Application
      • Use Application
  • Usage
    • Send Request To Endpoint
    • Request From Web Form
    • Web Form Controls Having Multiple Values
    • Web Form With File Upload
    • HTML Snippet embedded with Java Script
    • Authentication
    • Environments
    • Debug Mode
  • Configuration
    • Application Directory Structure
      • endpoints.xml
      • security.xml
      • email-sending-configuration.xml
      • service-portal-endpoint-menu-items.xml
      • Directory: data-source-post-processing
      • Directory: data-sources
      • Directory: data-source-xslt
      • Directory: fonts
      • Directory: http-xslt
      • Directory: parameter-xslt
      • Directory: static
      • Directory: transformers
      • Directory: xml-from-application
    • Endpoint Parameter
    • Types of Endpoints
      • Endpoint to Return XSLT Transformation
      • Endpoint to Return Content From Url
      • Endpoint to Return Static File
      • Endpoint to Return OOXML
      • Endpoint to Redirect Request
      • Forwarding Between Endpoints
      • Conditional Success Action
      • Error Case
    • Data Source Transformation
      • Load Parameter Values as a Data Source
      • Load Data From a Local XML File
      • Load Data from any REST-API
      • Load Data From Databases
      • List AWS S3 keys
      • Load AWS S3 object
      • Additional Useful Data Source Types
      • Transformation Options
      • Data Source Post-Processing
      • Using Parameter Placeholders in Data Sources
      • On-Demand Incrementing Number
      • Writing Transformation Input/Output to AWS S3
    • Parameter Transformation
      • Parameter Transformation Input
      • Parameter Transformation Output
    • Tasks
      • HttpRequest Task
      • Email Task
      • Create Shortlink Task
      • Request Log Task
      • Conditional Tasks
      • Parallel or Subsequent Execution of Tasks
      • Intermediate Values
    • PDF Created With XSLT
      • Embedding Fonts
      • Embedding Images
    • OpenEndpoints XSLT Specifics
Powered by GitBook
On this page
  • Option 1 - Email attachment
  • Option 2 - Insert file content into HTTP request body
Export as PDF
  1. Usage

Web Form With File Upload

PreviousWeb Form Controls Having Multiple ValuesNextHTML Snippet embedded with Java Script

Last updated 2 years ago

HTML web forms allow to send files along with the form data:

<input type="file" name="foo" />

<!-- It is possible to upload multiple files using the multiple attribute: -->
<input type="file" name="foo" multiple="true" />

OpenEndpoints automatically understands the correct enctype to separate uploaded content from form <input> data:

File Upload
enctype

Web form with no file upload

application/x-www-form-urlencoded

Web form with one or many file uploads

multipart/form-data

Once the file(s) have been uploaded by the user, the following options exist to do things with these files:

Option 1 - Email attachment

The allows to add all uploaded files as attachments:

<attachments-from-request-file-uploads/>

That means: It is not possible to select which file should be attached as an attachment. All files are always attached.

Option 2 - Insert file content into HTTP request body

When sending an HTTP request from OpenEndpoints using the , and when specifying that HTTP request should contain an XML body, and when that XML is specified inline, the optional attribute upload-files="true" may be set.

For example:

<xml-body upload-files="true">
    <foo upload-field-name="xyz" encoding="base64"/>
</xml-body>

This syntax indicates that the element <foo> will be filled with the contents of the uploaded file with the filename "xyz". The encoding is always base64, no other encodings are supported.

Email Task
HttpRequest Task