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
I am using "@aws-sdk/client-s3": "npm:@aws-sdk/[email protected]", to upload files to S3.
Here is sample code, uploading a 4KB file takes 6 seconds. The time is taken on step s3Client.send(command);.
I also tried uploading a 100MB file, took ~7.5 second. So the upload speed seems fine. Could it be issue with connection establish?
I ran the same code with bun, took 0.8ms to upload a 4KB file.
import{S3Client,PutObjectCommand}from'@aws-sdk/client-s3';// Configure the S3 clientconsts3Client=newS3Client({region: Deno.env.get('AWS_REGION')||'us-east-1',credentials: {accessKeyId: Deno.env.get('AWS_ACCESS_KEY_ID')||'',secretAccessKey: Deno.env.get('AWS_SECRET_ACCESS_KEY')||''}});// Function to upload a file to S3asyncfunctionuploadFileToS3(bucketName: string,key: string,filePath: string){try{// Read the fileconstfileContent=awaitDeno.readFile(filePath);constcommand=newPutObjectCommand({Bucket: bucketName,Key: key,Body: fileContent});console.time('send');constresponse=awaits3Client.send(command);console.timeEnd('send');console.log('File uploaded successfully:',response);}catch(error){console.error('Error uploading file:',error);throwerror;// Re-throw the error for better error handling}}// Example usageconstbucketName=Deno.env.get('AWS_BUCKET_NAME')||'';awaituploadFileToS3(bucketName,'wacv24-2686.mp4','/Users/hk/Downloads/wacv24-2686.mp4');
The text was updated successfully, but these errors were encountered:
We believe this was the same problem as in #27239 which should be now fixed by #27381. Please try out latest canary (deno upgrade --canary) and let me know if the problem persists.
Version: Deno 2.1.7
I am using
"@aws-sdk/client-s3": "npm:@aws-sdk/[email protected]",
to upload files to S3.Here is sample code, uploading a 4KB file takes 6 seconds. The time is taken on step
s3Client.send(command);
.I also tried uploading a 100MB file, took ~7.5 second. So the upload speed seems fine. Could it be issue with connection establish?
I ran the same code with bun, took 0.8ms to upload a 4KB file.
The text was updated successfully, but these errors were encountered: