Couldn't get image url using cloudinary in my ionic application using Node js


#1
fs.writeFile('./tmp/picture.jpg',imageBuff,function(err){
		if(err)
		{
			console.log('Error Found',err);
		}
		else
		{

			var fileName= process.env.GLOBAL_PATH+'/tmp/picture.jpg';
			console.log('this is fileName', fileName);
			cloudinary.uploader.upload(fileName, function(response)
			{
				var picture=new Pic();
				picture.name= req.body.name;
				picture.description=req.body.description;
				picture.url=response.secure_url;
				console.log('Image secure_url is' + response.secure_url);
				picture.save();
				res.status(200).end();
				console.log('This the response '+ res);
			});
		}
	})

This is the code where i’m having a problem


#2

Reading and writing files locally on device requires the use of the Cordova File Plugin https://ionicframework.com/docs/native/file/


#3

installed plugins but nothing comes off


#4

What exactly are you trying to do?
What error are you getting?
What is happening although it should not?
Or what is not happening although it should?


#5

I’m trying to capture the image and send it to cloudinary
The url of cloudinary repository should be saved in picture.url but I’m unable to get the url
the url is undefined which shouldn’t happen
The picture should go to cloudinary which is not happening


#6

Ok, what is this cloudinary.uploader you are using? (link)


#7

yeah this is what I’m using


#8

No I’m asking you what library you are using.


#9

sorry i just can’t understand what kind of library you are asking if you provide some hint so that i can easily tell. Please
or are talking about plugin
then i’m using cordova-camera plugin


#10

u there? cloudinary not working if there’s any suggestion?


#11

I don’t know what “cloudinary.uploader” is. Provide a link to where I can read documentation of something about it.


#13

http://cloudinary.com/documentation/node_image_upload this is the link for documentation


#14

Wait, the code in your first post is not from Ionic but from a Node.js application!?