File Upload
These APIs are used for large files (mostly videos) uploading.
Generate presigned URLs
Generate multipart upload presign URLs.
const response = await geocore.File.generateMultipartUploadPresignedUrls({
fieldName: 'video',
fileName: 'fileName.mp4',
numberOfParts: 4,
});
Prerequisites
Successfully get the IdToken with user access level from login API.
Parameters
name type data type description fieldName required string Field name (e.g. photo, video) fileName required string File name numberOfParts required string Number of parts to upload
Multipart upload notes
- Calculate number of file parts by dividing file size by part size.
- Part size can be between 5MB and 5GB.
- Maximum number of parts: 10000.
- Reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html
Complete
Complete multipart upload.
const response = await geocore.File.completeMultipartUpload({
fieldName: 'video',
fileKey: 'fileName.mp4',
fileId: 'string',
fileType: 'video/mp4',
parts: [{
PartNumber: 1,
ETag: 'string',
}]
});
Prerequisites
Successfully get the IdToken with user access level from login API.
Parameters
name type data type description fieldName required string Field name (e.g. photo, video) fileKey required string File key in S3 fileId required string File upload ID in S3 fileType required string File mime type parts[PartNumber] required string File part number parts[ETag] required string File part ETag
Abort
Abort multipart upload.
const response = await geocore.File.abortMultipartUpload({
fileKey: 'fileName.mp4',
fileId: 'string',
});
Prerequisites
Successfully get the IdToken with user access level from login API.
Parameters
name type data type description fileKey required string File key in S3 fileId required string File upload ID in S3