logo
logo

File Object

You can fetch files from an HTTP resource, based on specific parameters, and define its name according to the file URL.

Parameters

ParameterTypeDescription
typeStringThe type of source to retrieve the file from.: Web for an HTTP resource.
href*StringIn case of a Web type: the URL of the resource.

Web fetch

You can use the Web fetch source to retrieve resources that are accessible from an (optionally pre-signed) URL.

{    
    "type" : "Web",
    "href" : "http://www.url.to/file/online.jpg" 
}

You can use any URL. Make sure to take the filename from the Content-Disposition header if available, or make it up from the path. The href property specifies the URL to the resource.

The filename is retrieved automatically, based on the following rules, in order of execution:

  • If the URL refers to a filename, it uses that filename. Example: http://www.gstatic.com/webp/gallery/5.jpg results in 5.jpg

  • If there is a filename parameter in the URL, it uses the value in that file name. Example: http://picsum.photos/400/300/?image=1&filename=test.jpeg results in test.jpeg

  • If none of the above, it reverts to the hostname, top level domain, and a GUID (Globally Unique IDentifier). These concatenate automatically using _ (underscore). Example: http://picsum.photos/400/300/?image=1 results in picsum_photos_814be. Note that there are no file extensions.

Can we improve this article ? Provide feedback