Storing Files
Files can be uploaded to Sphinx using Get Presigned Url For Upload. This endpoint returns a presigned URL from AWS’ S3 you can use to POST files to.
Workflow
- GET storage information via
Get Presigned Url For Upload
. - POST to
presignedResponse.url
, addingpresignedResponse.fields
and your file. The file must be last. - POST using
path
inCreate File
andCreate Dataset
.
Addition of a file uses AWS’ native file upload mechanism is used for optimal performance.
You can read about the full endpoint here S3 POST Object but usage of this S3 endpoint is not required.
Instead you can send a POST request to the presignedResponse.url
you receive from Get Presigned Url For Upload
.
The path
field is used as the stagedUploadPath
parameter in Create File
and Create Dataset
.
An example for uploading a file to a stagedUploadPath
is below.
Note that usage of this file in Create Dataset
requires the tracking of a Task. See Get Task.