unsigned_cloudinary_upload, cloudinary_upload_url and use_filename: true
Hello
I wish to either upload a local image or give a remote url. In both cases I use unsigned_cloudinary_upload and the preset with use_filename: true. In the case of local file all works fine. But when I use remote url, in this way:
$('.cloudinary_fileupload').cloudinary_upload_url(upload_url_form.url.value);
image is uploaded successfully too but its name is set as full url path. That is in my case url to upload was:
and cloudinary had given this public id:
http_res_cloudinary_com_engineering-com_image_fetch_w_200_h_150_f_jpg_c_fill_http_www_engineering_com_portals_0_BlogFiles_matwater_CNTs_20for_20Cancer_amolhg
Please write me how can I get it as
CNTs_20for_20Cancer_amolhg
instead.
Thank you
Alex
-
Hi Alex,
Currently when uploading from a remote URL while enabling
use_filename
, Cloudinary indeed uses the whole URL as the public ID rather than the last component. While it's on our road-map to support this as well, in the meantime you can specify a custompublic_id
while uploading. Note that this can be also generated via on of our integration libraries. e.g., in .NET:var upload = cloudinary.Upload(new ImageUploadParams()
{
File = new FileDescription(@"http://www.example.com/my_image.jpg"),
UploadPreset = "my_preset",
PublicId = "my_image",
Unsigned = true
});0 -
Hi Itay
I have to do all things on the client side. This is my current code:
$('.cloudinary_fileupload').fileupload('option', 'public_id', 'artest1410291643');
$('.cloudinary_fileupload').cloudinary_upload_url(upload_url_form.url.value);
delete ($('.cloudinary_fileupload').fileupload('option', 'public_id'));
Unfortunately it does not work - the whole URL still is used, not 'artest1410291643' as I expected. What am I doing wrong?
Thank you
Alex
0 -
If you use unsigned uploads, you can use something like the following:
$('.cloudinary_fileupload').unsigned_cloudinary_upload(<upload\_preset>, {public_id: "my_image"});
0 -
Great thanks. It is working ok.
Please mark this topic as resolved.
0
Post is closed for comments.
Comments
4 comments