affanshahid / multer-storage-cloudinary

A Cloudinary multer storage engine
MIT License
104 stars 18 forks source link

Server timeout, new syntax does not work #16

Closed nax3t closed 3 years ago

nax3t commented 4 years ago

Hi there, The last time I used the package I had the following setup:

"multer-storage-cloudinary": "^2.2.1",
"multer": "^1.4.1",
"cloudinary": "^1.13.2",

And it worked. But, now with the new syntax changes in v4.0.0, the request times out and gets hung up on parser.single("image") or parser.array('images', 4), never making it to the next middleware function in the route.

I'm thinking it may be related to version 1.1 of upload_stream

Thoughts?

affanshahid commented 4 years ago

The uploading part uses stream.pipe already just as in previous versions. Can you make sure you are passing in require('cloudinary').v2 as the cloudinary property in the opts object? (the .v2 is important). Otherwise please share a snippet of your setup.

If the missing v2 is the cause of the problem then I suppose we can do some more type guarding to ensure people pass in the correct cloudinary object.

nax3t commented 3 years ago

that did the trick, thank you! sorry for the late reply