Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // postUrl is the s3 presigned url
- // file is the file object
- const uploadResponse = await fetch(postUrl, {
- "method": "PUT",
- "body": file,
- "headers": {
- "Content-Type": file.type
- },
- });
- if (!uploadResponse.ok) {
- console.error("Error in PUT request");
- } else {
- console.log("File uploaded successfully");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement