Memory storage option is not working.
See original GitHub issueI am using multer to upload images to my cloudinary account. Since the images will be uploaded to cloud I do not need them to be stored locally in my app. I am using the MemoryStorage option as given in the documentation.
var cloudinary = require('cloudinary');
var multer = require('multer');
var storage = multer.memoryStorage();
var upload = multer({ storage: storage });
var cloudinaryConfig = require('../config/cloudinary');
router.post('/', upload.single('image'), function(req, res){
cloudinary.config(cloudinaryConfig.connection);
cloudinary.uploader.upload(req.file.path,{tags:'basic_sample'},function(err,image){
if(err){
console.warn('------------------- ERROR: ' + err);
}
console.log("* public_id for the uploaded image is generated by Cloudinary's service.");
console.log("* "+image.public_id);
console.log("* "+image.url);
});
});
However while uploading the image is also uploaded to an “uploads” folder. Any idea what the problem is? Thank you.
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (3 by maintainers)
Top Results From Across the Web
How to Fix Insufficient Storage Available Error on Android
6 Ways to Fix "Insufficient Storage Available" on an Android · 1 Resetting Your Apps' Caches · 2 Uninstall Unwanted Apps · 3...
Read more >[SOLVED] How To Fix Insufficient Storage Available (Android)?
Solution 1: Clear App Cache to Free up Space on Android In general, the lack of working space is probably the main cause...
Read more >Memory and storage Troubleshooting | T-Mobile REVVL
Clearing app cache can resolve issues regarding poor performing applications due to memory consumption. You can clear app cache and data via the...
Read more >Internal storage isn't showing on windows - Microsoft Community
The internal storage of my smartphone sony Xperia R1 plus dual is not showing on windows,the SD card is showing on windows but...
Read more >How To Fix Storage Space Running Out Problem on Android
1. Phones with no option to increase storage space · Open your phone Settings. · Tap on Applications. · This will bring up...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i was able to upload it with memory storage. Cloudinary does not directly upload file buffer, i had to covert the buffer into a datauri.
Sorry for the delay on this, I think what’s happening is that you already have another multer middleware running before the
upload.single('image')
one. The memory storage doesn’t provide areq.file.path
property, but instead gives you a buffer atreq.file.buffer
.Can you show how the
router
object is being used?The following small example works for me: