1. Tasks
  2. Upload File

Tasks

Upload File

The Upload File task uploads an external file and attaches it to the stub.

Uses

  • Use this to get a file from an external source and attach it to a stub.
  • Use to download a document that is stored on a cloud storage service and attach it to a stub.
  • Use together with the apicall task to download a file that was generated by an API call and attach it to a stub.

Basic usage - External

Upload and attach an External image of the Stubber logo to the stub.

loading...

Parameters

upload_type
required
string

The type of upload. Options: external datauri


filename
string

The name of the file to use on the stub once it has uploaded.

Default: uuidv4()


upload_params
required
object

The parameters for the upload.

Show child attributes
url
required
string

The url of the external file to be uploaded

contentType
string

The MIME type of the file to be uploaded.

Default: application/octet-stream


Advanced usage - External

Upload and attach an External image of the Stubber logo to the stub. This example includes headers and a method. Any additional headers can be added to the headers object.

loading...

Parameters

headers
object

Optional HTTP Request Headers. The headers object can contain any number of key-value pairs.


method
string

The HTTP Method to use for the request. Options: GET POST

Default: GET

Basic usage - Datauri

Upload and attach a datauri file to the stub.

editor
        {
  "tasktype": "upload_file",
  "params": {
    "upload_type": "datauri",
    "filename": "Stubber Logo.png",
    "datauri":"[DATAURI STRING]",
  }
}

      
datauri
required
string

The datauri string of the file to be uploaded.

Properties

fileuuid
string

The uuid of the uploaded file.