Questions tagged [express-fileupload]

38 questions
0
votes
1 answer

Reading multiple files and uploading to AWS S3

Requirement: I have multiple files in a folder on my express server. I pass these file names as an API call, the backend function needs to read all these files, upload them to AWS S3 and then return an array of public URLs. const s3 = new…
0
votes
0 answers

Nodejs Wait for all promises to resolve and then redirect

I am facing the problem in redirecting to index page. Instead page refreshes to same create page perhaps due to large size images are still copying but why page refreshing instead of images waiting copying to finish and then redirecting. …
0
votes
1 answer

express-fileupload requires me to upload a file which is optional on the form

I have a challenge with express-fileupload when a user doesn't upload a file that is meant to be optional. Someone should please help me out. This is my code: const file = req.files.document; const file2 = req.files.document2; const uploader =…
0
votes
1 answer

How to upload image file with additional information like label or alt value in express-fileupload?

I am trying to add a label text in file object but when uploading in node.js through express-fileupload. Its uploading the file but label is missing. const [files, setFiles] = useState([]); const imageLabelChanger = (index, e) => { const value =…
0
votes
1 answer

req.files keeps returning undefined

req.files keeps returning undefined. I've tried connect-multiparty, body-parser, and express-fileupload. How do I make it work using express-fileupload and not multer? here's my frontend:
Mlemix
  • 57
  • 1
  • 2
  • 6
0
votes
1 answer

express fileupload package problem with the path

I'm encountering a problem when I want to upload a file to 'public' folder. This problem occurs when I don't use './'. if I use '../' or '/' files do not upload to the public folder. **controllers.js** files.forEach(file => { …
hyden97
  • 117
  • 2
  • 8
0
votes
1 answer

Node JS REST API image upload, how do i only upload jpg files and not png?

I am using express-fileupload as my middleware and POSTMAN as my API, how do I only upload jpg images and not others file extensions?
0
votes
1 answer

How can i resize uploaded image to some specific height and width using express fileupload

hi I'm using express file upload for uploading images in my NodeJS project but I need to resize the uploading image to 1000*1000 size and save to folder how can i do that router.post('/add-product', (req, res) => { // console.log(req.body) let…
ajay
  • 3
  • 1
  • 3
1 2
3