How to Upload Files

Help Topics
If you would like to upload files, you have the following options:
  • Upload single file as binary array.
  • Upload multiple files as part of HTML form data.
Important
You can select the above option in request item properties or in the request window. Example from the request window will be described here.

Upload single file as binary array

If you would like to upload single file as binary array, follow this procedure:
  • Enter execution URL and possible request headers.
  • Select appropriate HTTP method, for example, POST.
  • Select Single file contents as binary array from the upload data type drop down.
  • Select appropriate content type, for example, if you would like to upload a PNG image, select image/png.
  • Enter disk path to the file you would like to upload.
  • Execute the request tab and wait until the upload completes.
Important
If you are specifying this data in request item properties, you can specify file path relative to the project file.

Upload multiple files as part of HTML form data

If you would like to upload multiple files as part of HTML form data, follow this procedure:
  • Enter execution URL and possible request headers.
  • Select appropriate HTTP method, for example, POST.
  • Select Multipart form (HTML form with files) from the upload data type drop down.
  • Select multipart/form-data content type from the content type drop down.
  • Enter HTML form data items by entering each element on a separate line. For files specify their disk path and optionally content type; content type can be specified by entering it after the file disk path and separate both with a vertical bar.
    HTML form post example
    first_name=John
    last_name=Doe
    photo=C:\Files\Photo.jpg | image/jpeg
    resume=C:\Files\Resume.pdf | application/pdf

    If you would like to temporarily exclude particular data item from the upload, you can precede it with a double forward slash, for example, //first_name=John. Excluded data items will be ignored during the execution and won't be part of the request data.
  • Execute the request tab and wait until the upload completes. The upload process will include all data elements with valid file path as files; others will be included as plain text data.
Important
If you are specifying this data in request item properties, you can specify file paths relative to the project file.