js-url-gen icon indicating copy to clipboard operation
js-url-gen copied to clipboard

Question / Feature Request

Open Keith-Web3 opened this issue 1 year ago • 4 comments

I was wondering if there was a way to show an image preview of my file saved on Cloudinary. It might be made available for specific document types e.g. .pdf, images, .docx, etc. If this doesn't already exist, I hope it can be added to Cloudinary as this would make the package even more awesome.

Keith-Web3 avatar Dec 12 '23 02:12 Keith-Web3

How are you uploading the files? Do you use our upload widget? You can enable crop mode in the widget so you will get a preview of the document before uploading, you can see an example here (click the Crop and upload button).

tamaracloudinary avatar Dec 12 '23 14:12 tamaracloudinary

No, I'm uploading the files manually using the NodeJS SDK. And I need the preview image in other places other than when I'm uploading. It would be cool if there could be a link like https://cloudinary-file-path/preview that contains the preview image of that file.

Keith-Web3 avatar Dec 13 '23 07:12 Keith-Web3

I see, currently this is not something we support, as a workaround, you can upload the file using the NodeJS SDK as you're currently doing, and create a transformation URL to generate a preview of the uploaded file. This transformation URL will contain the necessary parameters to create a smaller or differently formatted version of the original image. For example:

https://res.cloudinary.com/your-cloud-name/image/upload/c_scale,w_200/sample.jpg

Then delete the image.

Please also feel free to suggest this on our public roadmap!

tamaracloudinary avatar Dec 13 '23 10:12 tamaracloudinary

A transformation URL? I'll check out the docs to know more about it and get back to you in case I need further assistance. Thanks 🙂

Keith-Web3 avatar Dec 16 '23 05:12 Keith-Web3