How can I download my uploaded PDF file using CloudinaryDotNet nuget?
Hello everyone.
First, thanks for nice API and nuget :)
Also thanks for quick guide on uploading files.
But I have a need to download file (pdf) from Cloudinary, how can I manage that using nuget?
Also, how can I find out paths to my file on Cloudinary? I need to store those paths in DB.
-
Hi Vadym,
You can use fl_attachment in the URL and that will let you download the file when the URL is accessed. For eg :
cloudinary.Api.UrlImgUp.Transform(new Transformation().Flags("attachment:pretty_flower").FetchFormat("auto")).BuildImageTag("sample.jpg")
or you could use the generate archive API methods.
More information here: https://cloudinary.com/documentation/image_upload_api_reference#generate_archive_method
DotNet test case : https://github.com/cloudinary/CloudinaryDotNet/blob/8762f2c70cce829a362452a79821730a87a084f5/Shared.IntegrationTests/UploadApi/ArchiveMethodsTest.cs#L149
To get the full file path on Cloudinary you can use list resource method and pass the name or prefix of the file and it will return a JSON response with the full URL.
More information on list resource method here: https://cloudinary.com/documentation/admin_api#get_resources
Thanks,
Aditi0 -
Hi Aditi,
Thank you!
0
Post is closed for comments.
Comments
2 comments