academind / node-restful-api-tutorial

This repository accompanies my YouTube series on building a RESTful API with Node.js: https://www.youtube.com/playlist?list=PL55RiY5tL51q4D-B63KBnygU6opNPFk_q
793 stars 540 forks source link

Unable to post products #10

Open PriyaJainDev opened 6 years ago

PriyaJainDev commented 6 years ago

I am following the same procedures as per the source code but still not able to post the data to mlab. Getting the following error in postman: { "error": { "message": "ENOENT: no such file or directory, open 'C:\\Users\\Priya\\Desktop\\sample\\node-restful-api-tutorial-13-controllers\\uploads\\2018-06-30T15:31:36.292ZCocker-Spaniel-Puppies-For-Sale-600x600.jpg'" } }

I have tried multiple times the same code but all useless. Kindly help out as soon as possible as it is urgent.

parammittal16 commented 6 years ago

@priya0607jain have you made an empty folder named 'uploads' to the path C:\Users\Priya\Desktop\sample\node-restful-api-tutorial-13-controllers\uploads before making any post or get request

PriyaJainDev commented 6 years ago

@parammittal16 yes I already have. Still could not solve it.

parammittal16 commented 6 years ago

Or there could be because of the double \ Which makes the url invalid !

SamuelCarmona83 commented 6 years ago

i have a code that post images served in heroku and conected to AltasDB an upload well but after few minutes i cant no longer access to the image posted before.

PriyaJainDev commented 6 years ago

I have not altered any configuration in the Maximillian's code. I am following the same code but still not able to post images. Again and again the error of 'path not define' or 'no ENOENT directory exists' type.

parammittal16 commented 6 years ago

Are u working on Linux or Mac ?

PriyaJainDev commented 6 years ago

Neither of them. Windows

ghost commented 6 years ago

@priya0607jain change to this: new Date().toISOString().replace(/:/g, '-') in your producs.js windows dont accept ";"