node-restful-api-tutorial icon indicating copy to clipboard operation
node-restful-api-tutorial copied to clipboard

Unable to post products

Open PriyaJainDev opened this issue 7 years ago • 8 comments

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.

PriyaJainDev avatar Jun 30 '18 15:06 PriyaJainDev

@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

parammittal16 avatar Jul 01 '18 12:07 parammittal16

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

PriyaJainDev avatar Jul 01 '18 17:07 PriyaJainDev

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

parammittal16 avatar Jul 01 '18 19:07 parammittal16

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.

SamuelCarmona83 avatar Jul 03 '18 21:07 SamuelCarmona83

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.

PriyaJainDev avatar Jul 14 '18 17:07 PriyaJainDev

Are u working on Linux or Mac ?

parammittal16 avatar Jul 14 '18 17:07 parammittal16

Neither of them. Windows

PriyaJainDev avatar Jul 14 '18 18:07 PriyaJainDev

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

niceguy1 avatar Aug 18 '18 17:08 niceguy1