is any tutorial available to get that image in angular
can anyone provide github link i am little bit confused
Hey there! That's a good Express REST API tutorial. I came here for only upload part of the application and I found this useful, thank you for your effort. I have a question if you spare few minutes. I implemented the same logic in my application. The task that my router should do is called after uploadImage middleware called, so If any error occurs in my router due to validation, but the application still uploads the image. I removed uploadImage middleware and did the upload part inside my router if validations are passed succesfully. Is this the correct method? And lastly, I couldn't see any way to implement async/await for upload method into the uploadImage logic, I checked out multer's API and couldn't find a method that does the same job but returns Promise. My current implementation has a callback hell, I'm not pretty happy about it. What do you think about it? Thanks in advance and keep amazing work! :)
Hi Victoria Lo ,
Awesome tutorial.Its really very good tut.
I have problem while using image upload from postman. Only when i use form-data method 'post' in POSTMAN i'm getting error while using image type file.
Getting this error name": "ValidatorError", "message": "Path name is required.".
But all the pervious code with out image is working fine with raw data with json data type. I try to debuge it .It happens only when i use form-data then in code req.body.name is not working but while using raw data using json its working. Should i need to use this
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
Can you please help me upload image using form-data using POSTMAN ?
Hi again!
There's a typo on Step 3 on this post. It's a missing closing parenthesis.
The code should be:
const uploadImg = multer({storage: storage}).single('image');
Yet another amazing one! π€©
Hi Victoria Lo,
Its working. Thanks a lot, Simple error on my side on routes. The way you explain the tutorial is amazing. Thanks once again for your support.
TEAM SCITS
HI. thanks for the amazing tutorial. But when I'm using it on server it's not working. Localhost is working . Why is it?