Uploadcare can fetch a file from a publicly available URL and then automatically upload the fetched file to your project.
Requests to the endpoint return a JSON dictionary with a token
that can be further used
to check the status of the upload
request.
Note: The token is not a file ID and can’t be used to address the file directly.
The actual file ID should be retrieved by calling the /from_url/status/
endpoint.
By default, every call to the /from_url/
endpoint with the same source_url
results in
a new upload leading to file duplication.
If you would like Uploadcare to keep track of the requested URLs and avoid the duplicate
uploads, pass the save_URL_duplicates
and check_URL_duplicates
parameters described below.
Source URL of the file to fetch and upload.
Note: The URL should point to a resource publicly available via HTTP/HTTPS.
Determines if an uploaded file should be marked as temporary or permanent.
The parameter can have the following values:
0
- do not mark an uploaded file as stored and remove it after 24 hours1
- mark the uploaded file as storedauto
- delegate the choice of the file-storing behavior to a project-wide setting called
auto-store.The default value depends on the user registration date.
For all users registered after February 12, 2024 (UTC 13:30), the default value is auto
.
File-storing behavior depends entirely on what is set in the
storage settings in the Dashboard.
For users registered before February 12, 2024, the default value is 0
.
To ensure that file storage in the project matches the settings in the Dashboard,
change the value to auto
.
Sets the file name of the resource fetched from the source URL.
If not defined, the file name is obtained from either HTTP
response headers or the source_url
’s path.
Note: The filename will be sanitized to only contain the following symbols:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789._
.
If set to “1”, enables the source_url
duplicates prevention.
Specifically, if the source_url
had already been fetched and uploaded previously,
this request will return information about the already uploaded file.
Determines if the requested source_url
should be kept in the history of
fetched/uploaded URLs. If the value is not defined explicitly, it is set
to the value of the check_URL_duplicates
parameter.
Arbitrary metadata associated with the file. See docs and REST API for more information.
signature
must be sent along with your upload request if you would like to use signed uploads.
The signature should be generated on your backend.
Note: the process requires knowledge of your Uploadcare Project’s Secret key.
See signed uploads for details.
expire
must be sent along with your upload request if you would like to use signed uploads.
The parameter defines the time during which your signature is valid. It’s a UNIX timestamp.
See signed uploads for details.