Uploading Files with JMeter

JMeter’s HTTP Request sampler can be used to upload files to a web application. Follow these steps:

  • Use the POST method (in some cases, the PUT method may be required).

  • Check the Use multipart/form-data for POST box:

    fileupload1.png

  • In the Files Upload section, provide the following values:
    fileupload2.png

    1. File Path: either an absolute or relative path to the file from JMeter’s “bin” folder.

    2. Parameter Name: the form name that contains the <input type="file" ...> tag. You can find this in the upload page’s source code.

    3. File MIME Type: the MIME type of the file being uploaded. In the example below, an xlsx file is being uploaded.

      file MIME
      html text/html
      txt text/plain
      rtf application/rtf
      gif image/gif
      jpeg,jpg image/jpeg
      au audio/basic
      mid,midi audio/midi,audio/x-midi
      mpeg video/mpeg
      avi video/x-msvideo
      gz application/x-gzip
      tar application/x-tar