s3
Never
require("module-alias/register"); const fs = require('fs') const s3Config = require('@commonService/uploadFile/s3Config') module.exports = { async uploadToBucket({ file, destination, mimetype }) { try { const params = { Key: destination, // File name you want to save as in S3 Body: fs.createReadStream(file), ACL: 'public-read', ContentType: mimetype } let uploaded = await s3Config .upload(params) .promise() return { uploaded, status: 1 } } catch (error) { return { error, status: 0 } } }, async getObjectFromBucket({ fileKey }) { try { const params = { Key: fileKey // File name you want to save as in S3 } let data = await s3Config .getObject(params) .promise() let file = data.Body.toString('base64') return { file, status: 1 } } catch (error) { console.log(error) return { error, status: 0 } } }, async cloneUrlToS3({ file, filename, mimeType }) { try { const params = { Key: filename, Body: file, ACL: 'public-read', ContentType: mimeType } let uploaded = await s3Config.upload(params).promise() return { uploaded, status: 1 } } catch (error) { return { error, status: 0 } } } } // module.exports.getObjectFromBucket({ fileKey: "users/5ed1fed961ff8a286dd54d48/resume/1590820808191.pdf" })
Raw Text
-
FAMILY SINNERS - Naughty Babe Demi Hawks Finally Gets In Her Hot Step Uncle Derrick Pierce's Pa
6 min ago
-
https://www.facebook.com/BloomCBDGummiesUS/
7 min ago
-
Life Boost CBD Gummies
11 min ago
-
c pl oli
25 min ago
-
Inked Asian Spinner Morgan Lee Fucks
36 min ago
-
https://pgccouncilcsp.powerappsportals.us/forums/general-discussion/ad846e56-bb02-ef11-a73d-001dd806
47 min ago
-
Big Ass PAWG Emily Tries To Take BBC Deep
1 hour ago
-
CBD Guru Gummies United Kingdom Reviews
1 hour ago
-
Untitled
1 hour ago
-
Cuckold licks pussy of his whore girlfriend and eats lover cum
1 hour ago