Questions tagged [multer]
Multer is a node.js component used to handle multipart/form-data uploads.
multer
1,648
questions with no upvoted or accepted answers
9
votes
0
answers
3k
views
Creating Multer storage engine
I'm setting image uploads with Express and Multer. My router handler will receive a formData with multiple files: I want to process them to multiple resolutions and save them in folders with the name ...
9
votes
0
answers
2k
views
Multer - get underlying file's content during fileFilter
I'm trying to make sure the uploaded file is an image, while using multer to handle the file upload.
The fileFilter function takes the form of the following:
var fileType = require('file-type');
...
6
votes
0
answers
2k
views
Mocking a File object in NestJs unit test with Jest
I recently started working with Nest.js and its built-in unit testing library Jest, while on a task to upload a .CSV file and perform some operations on it, I decided to also unit test the endpoint ...
6
votes
0
answers
699
views
How can be parse `multipart/mixed` in node.js?
I see lot of module in node.js like busboy , multer , formidable but they are not able to parse multipart/mixed body.
Example of the request multipart/mixed in node.js
--batchbatch
Content-Type: ...
6
votes
0
answers
4k
views
How can I check file size of uploaded file using multer
I am using multer for file uploading and i am uploading multiple file at time and it's working,but I want to set each file size limit and all files combine limit. How can I set this?
const storage = ...
6
votes
0
answers
2k
views
Show progress when uploading file with Multer
I'm having some trouble, I'm currently trying to teach myself some NodeJS but I'm stuck.
I am trying to upload a file using Multer, which I have gotten fully working, but I'd like to show the progress ...
6
votes
0
answers
466
views
Trying to upload image mongodb(mlab)
I am trying to upload image to server as well as to local folder using node js. But the problem is that when i try to post form with enctype then image saves only in local folder, and not in mongodb. ...
6
votes
1
answer
393
views
React Native IOS application can not upload image through Express+ multer server
React Native IOS application, want to upload image; from device.
RN 0.39.2
Client:
const formData = new FormData()
formData.append('files', file)
formData.append('type', 'image')
fetch(API_HOST+...
6
votes
1
answer
6k
views
How to determine the duration of a audio file in Node or Express?
I am uploading an audio file from a form to the server using the module multer with Express. I would need to know the duration of the track somehow. Is that possible, and if yes, how?
5
votes
1
answer
2k
views
React Native Image Upload with FormData to NestJS server using a FileInterceptor, but 'file' is undefined
My React Native application receives a selected image using the react-native-image-picker library and I need to send that image to a back-end running a NestJS server. The endpoint uses @UseInterceptor ...
5
votes
0
answers
1k
views
How to upload folders and keeping the folder structure with Node.js?
I'm currently trying to build a File Uploader with Node.js and it works fine for single files and multiple files, I need to upload folders tho. The folder structure within the uploaded folder should ...
5
votes
0
answers
570
views
Create ReadStream And Uploade Files to a Remote Server via multer
So I Want Upload Large File To Remote,So I Am Creating ReadStream
const stream = fs.createReadStream(req.file.path);
async uploadStream(stream: NodeJS.ReadableStream, filePath: string) {
...
5
votes
2
answers
1k
views
Is it possible to get image dimensions (width and height) using Multer before the image gets saved/uploaded
I'm using Multer with Express and I'm trying to retrieve image dimensions (width and height) before I upload the image to AWS S3.
My goal is to validate the image by image size, image type and image ...
5
votes
0
answers
1k
views
Upload Image from React Native to MongoDB Atlas using Nodejs Express Multer
I am trying to upload a profile image of a user from React Native App(Android). I am new to uploading image so I searched and found a package called multer. As I am using Mongodb Atlas, multer has a ...
5
votes
0
answers
3k
views
How to use jest to test an endpoint that expects formData and uses multer?
I have TypeScript setup and I am testing an endpoint that takes FormData as an input and uses multer to process the multipart data (pdf file); it looks like this:
app.post("/v1/sources/send-email",
...