Download

Download a file to the Workflows file system over HTTP or HTTPS.  You can use this function to download any file that you can access through a URL in your browser (such as an image or a document file).

NOTE: File functions does not support shareable links such as those from Box, OneDrive, or Google Drive.

Input Fields

  • URL (text): URL of the request, including the protocol http:// or https://

  • Headers (text): user-created fields to define headers to use in the file request

  • Query (text): user-created fields to define query parameters to use in the file request

Output Fields

  • File Content (file): ID of the file contents

  • Filename (text): filename of the downloaded file

  • Size (number): size of the downloaded file, in bytes

Use Download Function

To use this function:

  1. Enter the URL, including the http:// or https:// part, in the URL field.

  2. Optionally, use the Query section to build a query string.

For example, if you wanted to download a file from https://www.example.com/download?filename=foo.txt, then you express this in one of two ways:

  • you could put that whole string into the URL input; or.

  • you could set the URL to https://www.example.com/download, create an input filename in the Query section, and enter a value of foo.txt. This method is easier when the value of filename comes from a previous step in the Flow. You can drag the field into the input.

  1. Optionally, set headers in the request.

For example if the site requires authorization, you could add a header "Authorization: Bearer my-token" by adding an Authorization key to the Headers section and setting its value to Bearer my-token.  You can also set "Content-type: application/image" similarly.

  1. Optionally, drag the ID value from the File Content output field to the File input of another card, such as a Box upload card.

See Also

Functions in Workflows

About the elements of Okta Workflows