File Upload URL

With this import configuration, the cleaned file will be sent to an URL you provide for each importer session. This can for example be a presigned S3 upload URL. To use this import method, specify importConfig: { type: "file-upload", url: "<upload-url>"} in your configuration for OneSchema.

This supports sending the data as a CSV or JSON file.

The file data will be sent in the body of a single PUT request to the provided URL.

Presigned S3 Upload URL Requirements

The presigned URL has to be created by someone who has permission to create files in the S3 bucket.

Besides the bucket and key parameters you also have to set the content-type in the parameters when creating the presigned URL. In the case of a CSV file, it should be set to text/csv, and in the case of a JSON file to application/json. If this is not set correctly the upload request will fail with a 403 status code.

Since you provide the URL when initializing the importer make sure the URL has a long enough expiration duration to give your user enough time to go through the import workflow.