You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
here is my code and result is a http:// link (http:/xxxx/6b485c7-b1c5-45f1-a027-d0da6eaae7a4_0)
`export const uploadMultipart = async ({
path,
key,
module,
}: {
path: string;
key: string;
module: string;
}) => {
const compressedPath = await Video.compress(
path,
{
compressionMethod: 'auto',
minimumFileSizeForCompress: UPLOAD_CONFIGS.getMaxSize('video', module),
},
_progress => {},
);
const fileSize = (await blob.fs.stat(path)).size;
const compressedSize = (await blob.fs.stat(compressedPath)).size;
console.log(
File change from ${changeToMb(fileSize)}mb to ${changeToMb(compressedSize)}mb
,);
const fileData = await blob.fs.readFile(compressedPath, 'base654');
const buffer = Buffer.from(fileData, 'ascii');
console.log('File buffer: ', buffer.join('').slice(1, 100));
return new Promise<string | undefined>(async (resolve, reject) => {
try {
const parallelUploads3 = new Upload({
client: s3Client,
params: {Bucket: S3.AWS_BUCKET, Key: key, Body: buffer},
partSize: UPLOAD_CONFIGS.multipartSize,
});
});
};`
Beta Was this translation helpful? Give feedback.
All reactions