How to use with form upload and express 4?
See original GitHub issueI’m trying to use this to upload a file via a form post. It worked fine using express 3 but with express 4 the request.files object is empty. There have been suggestions online to use multer or busboy but I cant figure out how to implement them with s3-uploader. Here is a copy of upload function
exports.upload = function (req, response) {
var filepath = req.files.image.path;
var s3config = require('../config/aws.json');
var client = new Upload('bucket-name', {aws: s3config})
client.upload(filepath, {}, function (err, versions, meta) {
});
}
req.files object is always empty. Any suggestions on how I get that object to contain the file info?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Multer: Easily upload files with Node.js and Express
Multer is a Node.js middleware for handling multipart/form-data that makes the otherwise painstaking process of uploading files in Node.js ...
Read more >How to Handle File Uploads from Node.js to Express - Twilio
Learn how to upload files by posting multipart/form-data from Node.js to Express with the help of the FormData and Multer libraries.
Read more >Express Tutorial Part 6: Working with forms - MDN Web Docs
Express itself doesn't provide any specific support for form handling operations, but it can use middleware to process POST and GET parameters ...
Read more >How to Handle File Upload with Node and Express 4.0 | e-Zest
The first, get the method in the router caters to the browser's request to show the page and paints our uploadPage, with upload...
Read more >How to upload files in Node.js and Express
A comprehensive guide to learning how to upload single and multiple files in Node.js.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It can work with express v4 but you will need a middleware for handling
multipart/form-data
. (like multer). It will populatereq.files
/req.file
. Can you add this and try again?If something pops up, feel free to open this issue.