Lepozepo / cloudinary

MIT License
94 stars 42 forks source link

ENOENT error 34 when uploading from local filesystem #43

Open kingpalethe opened 9 years ago

kingpalethe commented 9 years ago

I've installed the package from atmosphere, entered my credentials.

I have it running on my dev server, and I can run for example this code:

Cloudinary.uploader.upload('https://dl.dropboxusercontent.com/u/2128641/dwu7a5cen1zpqy08itbv.jpg';, function(result) { 
console.log(result); 
});

.. And this work well! I get back the result with the public_id.

The problem is I cannot figure out how to upload from my local file system.

When I specify this path:

'~/workspace/ezvoice/processing/dwu7a5cen1zpqy08itbv.jpg'

I get this error

{ error: 
{ [Error: ENOENT, open '~/workspace/ezvoice/processing/dwu7a5cen1zpqy08itbv.jpg'] 
errno: 34, 
code: 'ENOENT', 
path: '~/workspace/ezvoice/processing/dwu7a5cen1zpqy08itbv.jpg' } }

In my Cloud9 workspace, I can click on this file path and it will open the image directly, so i am sure that the path is right.

I was thinking that it was a permissions issue, but I set the permissions on the file to 777, with no luck.

I also thought it might be a strange Cloud9 issue, so i cloned the project to Mac, but I get the exact same error message.

For some reason Cloudinary does not like my image path. I have also tried moving the image around, without luck.

any ideas?

thanks

kingpalethe commented 9 years ago

I seem to have a solution, explained here:

http://stackoverflow.com/questions/29743806/getting-meteor-private-folder-path-in-meteor-deploy-environment

This seems to be poorly documented, but as far as I can tell, this is the only way to access a file on the local filesystem in meteor.

Lepozepo commented 9 years ago

@alexanderperls why do you need to access the local file system? This package does not support file system uploads, it only supports blobs and File type files. If you want to upload from your local file system you need to use Cloudinary's NodeJS package and Node to access the filesystem. You would also need to develop a stream to get it going. You can have a look at my previous versions of this package, I had it tapping the server so one of the functions there will be useful for your use case.