Comments (5)
Thank you for reporting this issue. We will look into it.
Can you please share the code that reached the HTML response of the 500 error?
from cloudinary_npm.
Thank you! I will do that in the evening as currently have no access to my project from work. Btw, best practise would be to assume that everything could break especially when communicating with external resources (in this case - your HTTP API).
As the error fires in one of the response event callbacks, end developer does not have any control to make it fail-save as it the event callback fires out of try catch scope :(.
from cloudinary_npm.
The issue which was causing your servers to respond with HTTP 500 status code was that for some reasons binary buffer which I was sending upload_stream()'s object was saved as your temp file in FS, but was not able to process it further properly:
exports.sampleExpressJsAction = function(req, res) {
var stream = cloudinary.uploader.upload_stream(function (response) {
// before coming here it dies with error mentioned in my original issue comment
console.log(response);
});
req.on('data', stream.write);
req.on('end', stream.end);
};
...but... if I save the Buffer first into file and then re-read it passing into upload_stream() stream object in the same manner it WORKS! Completely bizzarre...
Both buffer objects (request and file's) are identical. Have no clue why does it happen.
from cloudinary_npm.
Fixed in #9
from cloudinary_npm.
Thank you for all your contributions and for sharing the code. The pull requests were merged into the master branch and are part of the latest released v1.0.1 of the NPM.
We will make sure that the service avoids returning HTML responses for API requests.
from cloudinary_npm.
Related Issues (20)
- Remove the Node.js 6 support HOT 1
- Custom Analytics IDs Don't Produce Custom Code HOT 1
- Wrong response type from https://api.cloudinary.com/v1_1/<cloud>/auto/upload HOT 4
- Webpack on nextjs always throws depency warnings HOT 27
- Cloudinary API corrupts UTF-8 public IDs/file names HOT 2
- When will Cloudinary support node 18 or a later version? HOT 6
- Invalid signature HOT 2
- Error while uploading profile image Cannot read properties of undefined (reading 'path') HOT 1
- Property 'next_cursor' does not exist on type 'ResourceApiResponse' HOT 2
- Missing`upload_stream` documentation HOT 6
- Escaping overlay text seems impossible in the version 1.41.0 HOT 6
- Unexpected token < in JSON at position 0. Status code 500 in Nextjs 13 production build (App router) HOT 9
- Support passing in analytics product version to URL generation HOT 2
- Typescript error on search API HOT 2
- Invalid signature String to sign HOT 2
- Cloudinary.com Signup Process HOT 3
- Missing return types on v2.api.resources() HOT 4
- Uploading file as buffer does not works in production. HOT 17
- "Error: must supply api_key" in heroku log HOT 3
- mp3 file is not being deleted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudinary_npm.