Flag of Ukraine
Our /http/import Robot

Import files from web servers

🤖/http/import imports any file that is publicly available via a web URL into Transloadit.

The result of this Robot will carry a field import_url in their metadata, which references the URL from which they were imported. Further conversion results that use this file will also carry this import_url field. This allows you to to match conversion results with the original import URL that you used.

This Robot knows to interpret links to files on these services:

  • Dropbox
  • Google Drive
  • Google Docs
  • OneDrive

Instead of downloading the HTML page previewing the file, the actual file itself will be imported.

Usage example

Import an image from a specific URL:

{
  "steps": {
    "imported": {
      "robot": "/http/import",
      "url": "https://demos.transloadit.com/inputs/chameleon.jpg"
    }
  }
}

Parameters

  • ignore_errors

    Array of Strings / Boolean ⋅ default: []

    Possible array members are "meta" and "import".

    You might see an error when trying to extract metadata from your imported files. This happens, for example, for files with a size of zero bytes. Including "meta" in the array will cause the Robot to not stop the import (and the entire Assembly) when that happens.

    Including "import" in the array will ensure the Robot does not cease to function on any import errors either.

    To keep backwards compatibility, setting this parameter to true will set it to ["meta", "import"] internally.

  • url

    String / Array of Stringsrequired

    The URL from which the file to be imported can be retrieved.

    You can also specify an array of URLs or a string of | delimited URLs to import several files at once. Please also check the url_delimiter parameter for that.

  • url_delimiter

    String ⋅ default: "|"

    Provides the delimiter that is used to split the URLs in your url parameter value.

  • headers

    Array of Strings ⋅ default: []

    Custom headers to be sent for file import.

    This is an empty array by default, such that no additional headers except the necessary ones (e.g. Host) are sent.

  • force_name

    String / Array of Strings / Null ⋅ default: null

    Custom name for the imported file(s). Defaults to null, which means the file names are derived from the supplied URL(s).

  • import_on_errors

    Array of Strings ⋅ default: []

    Setting this to "meta" will still import the file on metadata extraction errors. ignore_errors is similar, it also ignores the error and makes sure the Robot doesn't stop, but it doesn't import the file.

  • fail_fast

    Boolean ⋅ default: false

    Disable the internal retry mechanism, and fail immediately if a resource can't be imported. This can be useful for performance critical applications.

Demos

Related blog posts