-
Notifications
You must be signed in to change notification settings - Fork 868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avatar Upload failed #115
Comments
https://github.com/moayaan1911/backend-mastery Here is my repo |
Hey, I encountered a similar issue as well. The problem arose due to a configuration error in my Cloudinary configuration setup. After addressing the issue by adjusting my Cloudinary settings, my problem was resolved. I suggest reviewing your Cloudinary configuration to ensure it is properly configured. |
But my images are not getting stores in local public folder either.. |
That can be because of |
The problem is because your dotenv file is not configured properly. To check this in cloudinary upload function do a console.log(process.env.CLOUDINARY_SECRET_KEY) ( whatever name you have given ). If you are getting null in terminal, then below configuration will work.
And in package.json write this script
Now restart your server manually not through nodemon. |
try after re-select the file in postman. It happens sometimes. |
I also encountered this issue that my images were not getting stored in the public folder but removing all fields from Postman and re-entering the fields in form data worked for me Try it once |
Related to hiteshchoudhary#115 Remove the deletion of local files after uploading to Cloudinary. * Remove `fs.unlinkSync(localFilePath)` from `src/utils/cloudinary.js` to prevent deletion of local files after upload. * Ensure the function `uploadOnCloudinary` returns the response from Cloudinary.
State to the Soltuiton:
REASON: I know thats not a good practice to call the dotenv file mupltiple times in your code , even though we had config them at our index.js ...but the solution i gave worked for me .After struggling with error for 3 days.. |
I noticed that in my public folder the images I am sending from postman is NOT GETTING stored, I tried debugging it but couldn't find the solution
The text was updated successfully, but these errors were encountered: