multer-s3

nodejs, multer, aws S3

爱⌒轻易说出口 提交于 2021-01-09 07:41:00
问题 How do i apply uuid and date so that the filename stored in my database and the filename stored in my S3 bucket are the same? With this current implementation, the uuid and the date are always the same even if a post was made hours later. Can someone help, would really appreciate it. const s3 = new AWS.S3({ accessKeyId: process.env.AWS_ID, secretAccessKey: process.env.AWS_SECRET, region:process.env.AWS_REGION }) const uid =uuidv4(); const date =new Date().toISOString() const multerS3Config =

Getting SignatureDoesNotMatch: null error while uploading images to DigitalOcean Spaces using multers3 node.js

给你一囗甜甜゛ 提交于 2021-01-05 07:24:06
问题 Error: code:'SignatureDoesNotMatch' extendedRequestId:undefined message:null name:'SignatureDoesNotMatch' region:null // Load dependencies const aws = require('aws-sdk'); const express = require('express'); const multer = require('multer'); const multerS3 = require('multer-s3'); const app = express(); // Set S3 endpoint to DigitalOcean Spaces const spacesEndpoint = new aws.Endpoint('fra1.digitaloceanspaces.com'); const s3 = new aws.S3({ endpoint: spacesEndpoint, accessKeyId: '*************',

how to secure s3 files with trusted signed users using cloudfront aws-sign?

雨燕双飞 提交于 2019-12-12 05:36:54
问题 I need to secure my files which should not get directly played or downloaded in the browzer after copy pasting the link in the browzer. Below is my app.js file: var express = require('express'), aws = require('aws-sdk'), bodyParser = require('body-parser'), multer = require('multer'), multerS3 = require('multer-s3'); var cfUtil = require('aws-cloudfront-sign'); /**************************/ var cfPk = '-----BEGIN RSA PRIVATE KEY-----\n' +

Uploading image to amazon s3 using multer-s3 nodejs

假如想象 提交于 2019-11-28 18:27:15
I am trying to upload an image to amazon s3 using multer-s3 , but I am getting this error: TypeError: Expected opts.s3 to be object node_modules/multer-s3/index.js:69:20 This is my server code: var upload = multer({ storage: s3({ dirname: '/', bucket: 'bucket', secretAccessKey: 'key', accessKeyId: 'key', region: 'us-west-2', filename: function (req, file, cb) { cb(null, file.originalname); } }) }); app.post('/upload', upload.array('file'), function (req, res, next) { res.send("Uploaded!"); }); Why I am getting this error? Complete and working Node Cheat | Upload to s3 using multer-s3 available

Simple file upload to S3 using aws-sdk and Node/Express

旧时模样 提交于 2019-11-28 15:39:56
I am at a loss of what I am doing wrong, here is what I have: HTML <html> <body> <form method="POST" action="/upload" enctype="multipart/form-data"> <div class="field"> <label for="image">Image Upload</label> <input type="file" name="image" id="image"> </div> <input type="submit" class="btn" value="Save"> </form> </body> </html> Port 5000 is my Node.js server's port. In this example I am using POST to /upload , and it works fine. module.exports = function(app, models) { var fs = require('fs'); var AWS = require('aws-sdk'); var accessKeyId = process.env.AWS_ACCESS_KEY || "xxxxxx"; var

Simple file upload to S3 using aws-sdk and Node/Express

孤街浪徒 提交于 2019-11-27 19:47:22
问题 I am at a loss of what I am doing wrong, here is what I have: HTML <html> <body> <form method="POST" action="/upload" enctype="multipart/form-data"> <div class="field"> <label for="image">Image Upload</label> <input type="file" name="image" id="image"> </div> <input type="submit" class="btn" value="Save"> </form> </body> </html> Port 5000 is my Node.js server's port. In this example I am using POST to /upload , and it works fine. module.exports = function(app, models) { var fs = require('fs')

How to access uploaded file from multer?

我怕爱的太早我们不能终老 提交于 2019-11-27 13:22:00
问题 Im able to upload an image to S3 . Now, if the file selected is .gif , I want to be able to convert the .gif file to .mp4 and upload the converted file to S3 . I am able to convert a .gif to .mp4 with ffmpeg only if I give the path of the file. How do I access the uploaded file from Multer ? Below is my code : var express = require('express'); var bodyParser = require('body-parser'); var app = express(); var aws = require('aws-sdk'); var multer = require('multer'); var multerS3 = require(