Advertisement
Guest User

Untitled

a guest
Aug 29th, 2023
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.             // postUrl is the s3 presigned url
  2.             // file is the file object
  3.             const uploadResponse = await fetch(postUrl, {
  4.                 "method": "PUT",
  5.                 "body": file,
  6.                 "headers": {
  7.                     "Content-Type": file.type
  8.                 },
  9.             });
  10.  
  11.             if (!uploadResponse.ok) {
  12.                 console.error("Error in PUT request");
  13.             } else {
  14.                 console.log("File uploaded successfully");
  15.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement