Lepozepo / cloudinary

MIT License
94 stars 42 forks source link

'cloudinary_upload' undefined error #12

Closed wiseworksSteve closed 9 years ago

wiseworksSteve commented 9 years ago

This may be noob problem but I can't get this package to work.

I followed the readme, and things appear to work on the client side. But when it tries to call the server method - I've tried both 'cloudinary_upload' and 'cloudinary_upload_stream' - the server throws an error: Exception while invoking method 'cloudinary_upload' undefined

The method is clearly defined in the server.js file. I've verified that the package is installed. I have no idea why meteor can't seem to find this method, and worse, I have no idea how to troubleshoot it.

Lepozepo commented 9 years ago

That is strange. Did you try uninstalling and reinstalling? Maybe something got messed up along the way?

Marcelo Reyna

On Sat, Oct 4, 2014 at 1:41 AM, wiseworksSteve notifications@github.com wrote:

This may be noob problem but I can't get this package to work. I followed the readme, and things appear to work on the client side. But when it tries to call the server method - I've tried both 'cloudinary_upload' and 'cloudinary_upload_stream' - the server throws an error: Exception while invoking method 'cloudinary_upload' undefined The method is clearly defined in the server.js file. I've verified that the package is installed. I have no idea why meteor can't seem to find this method, and worse, I have no idea how to troubleshoot it. The relevant client side code:

{{#c_upload callback="saveImageUrl"}} {{/c_upload}}

On the server I'm just logging the response for now: Meteor.methods({ saveImageUrl: function(response) { console.log('Add '+response.upload_data+' to the id of '+response.context); }

});

Reply to this email directly or view it on GitHub: https://github.com/Lepozepo/cloudinary/issues/12

wiseworksSteve commented 9 years ago

I actually ended up removing all packages, updating my app to the latest version of Meteor, and then reinstalling all of my packages using the new Meteor package handling functionality. Still no luck. Everything else seems to work fine.

wiseworksSteve commented 9 years ago

This is a confirmed newbie issue. I thought that I followed the readme, but I was adding the configuration details to me settings file without ever actually setting up the cloudinary configuration on the server. I added an extra step for myself and forgot to take it. My goof.

fabyeah commented 9 years ago

I would like to upload files from the server, but it's not possible, because server.js is not loaded in package.js. Is that right? Or am I missing something?

Lepozepo commented 9 years ago

Uploading from the server is more complex than uploading from the client. A previous version of this package used server uploads but I decided to remove support for it since it is inefficient for the server to be uploading when the client can do it. Are you trying to upload files that are local to the server?

fabyeah commented 9 years ago

Yes, I want to upload files being sent to my app via POST request.

My solution now is to add the cloudinary npm package via meteorhacks-npm. It works because the global variable is named "cloudinary" with a lower case "c". So there is no conflict with the "Cloudinary" from this package.

I think it is useful to have the server upload feature, for cases like this.