Questions tagged [express-fileupload]
38 questions
3
votes
3 answers
I can't upload an image using ESM for cloudinary
I have a problem in this part of my code,with COMMONJS and it's working, my question is how can I make it work on ESM,
I've tried this but not workiing :
import express from 'express';
const router = express.Router();
import cloudinary from…

Ronice Yemeli
- 43
- 5
3
votes
1 answer
Uploading a file with express-fileupload doesn't work
I'm attempting to upload a file with express-fileupload (express-fileupload) in Node js.
But I wasn't successfully yet.
My app.js (where my express server is running) looks like this:
const express = require('express');
const exphbs =…

Lukas Keller
- 51
- 1
- 6
3
votes
1 answer
Forward file upload data to another API as is with node and express
I have a node endpoint with takes post request for uploading files. I am able to read the data(file) being send from the browser, now I want to forward the data or the whole request to another server hosted somewhere else. I am using node, express…

me_digvijay
- 5,374
- 9
- 46
- 83
2
votes
0 answers
How to fix 'Error: Write EOF' when running a nodejs file which spawns a child process running ffmpeg?
I am new to nodejs scripting and I am trying to create a program which receives a video file as a buffer and creates a thumbnail from it. This is my code:
create_thumbnail.js:
const { Readable } = require('stream');
const child_process =…

Prithivin Lakshminarayanan
- 127
- 1
- 9
2
votes
1 answer
Sharp unable to read file buffer
I'm using express-fileupload for reading files from the API. Now I want to process the image in the request body using Sharp.
I don't want to first save the file at the server and process it using fs.readFileSync.
I tried passing…

IshduttT
- 179
- 1
- 14
2
votes
1 answer
How to upload image with optional data in multer?
File object sending from frontend using react and formData
I have manually made the file object looks like...
Output of files
After uploading a file i am getting the object in multer and express-upload
console.log(req.files.productImages)
[{
…

Kamalesh Maity
- 119
- 7
2
votes
1 answer
Express: Image from vue.js is not redirected to backend
I have a vue app which calls the backend through express. When I add an image to a request the request is not redirected to the backend. However, when I call the backend directly from the vue app, without express, the request is handeled correctly.…

flavian
- 21
- 1
2
votes
0 answers
NodeJS: How would I render two pages?
So I am making a file upload website that when file is uploaded, it renders an uploading page that says it's uploading the file but when trying to render the success page, it won't do it since a page has already been rendered. How would I make it…

SirStopIt
- 102
- 2
- 16
1
vote
1 answer
Buffer.byteLength vs file size
I have a file that is roughly 51Mb (as seen in Finder). "GetInfo" shows Size: 51,534,849 bytes (52.3 MB on disk)
When I upload this file to the server the byteLength of the uploaded Buffer is a lot smaller. Does it depend on the file type or any…

chibis
- 658
- 2
- 12
- 22
1
vote
1 answer
nodejs express-fileupload - wrong encoding on filename in docker environment
I'm struggling with wrong encoded multipart form filenames uploaded to a nodejs backend.
Running the node application locally works as expected and the filenames arrive with propert utf-8 encoding. As soon as i run the application in a docker…

F.H.
- 1,456
- 1
- 20
- 34
1
vote
0 answers
Javascript convert Object containg file to FormData
I have node js application which uses express and express-fileupload.
I created such post mapping to accept file like this:
app.post("/upload", async (req, res) => {
if (!req.files) {
return res.status(400).send("No files were…

Anton Klichkov
- 133
- 1
- 3
- 11
1
vote
1 answer
Can't upload large files
I am using react on frontend and express on backend.
Here is my code that I use to upload files:
const formData = new FormData();
formData.append('file', blob);
formData.append('title', videoName);
const request = new…

Cery
- 51
- 2
- 4
1
vote
1 answer
formData in React, sending to backend Express recieved null
i'm doing image upload in my mern app and i'm using express-fileupload package, in the frontend i'm sending a image in FormData, but backend recives null.
frontend
const [infos, setInfos] = useState({title: '', text: '', image: ''})
const handleImg…

A.Anvarbekov
- 955
- 1
- 7
- 21
1
vote
2 answers
why my req.files always null while req.body have the file :upload file with express-fileupload/reactjs
i need ur help i can't find the mistake :
I m trying to upload a file in my code using express-fileupload but in nodemon the req.files are always null: files: null but I find that my file attribute pass to req.body like : body: { file: '[object…

SOU KAINAA
- 13
- 3
1
vote
1 answer
Express fileupload mv() function override the existing file if the same name is given?
This is my code:
if (req.files && req.files.logo) {
const logo = req.files.logo
logo.mv('./static/' + logo.name)
fields['logo'] = logo.name
}
so if the file with the same name is uploaded then does the above logo.mv function call…

Dan Robert
- 55
- 8