Downloading a pdf file

ryan202
ryan202 Member Posts: 1
edited July 2023 in Developer APIs

Hi.

I'm trying to create a downloadable link from a uploaded pdf file but struggling.

If the original url is https://res.cloudinary.com/<db id> /image/upload/v1688608254/<folder name>/example.pdf

shouldn't the download link be https://res.cloudinary.com/<db id>/image/upload/fl_attachment/v1688608254/<folder name>/example.pdf ?

Please correct me for my wrong doings.

Thank you.

Tagged:

Best Answer

  • Tom
    Tom Member, Cloudinary Staff Posts: 106
    Answer ✓

    Hi @ryan202 ,

    Thanks for reaching out.

    That is the correct format but you need to enable PDF/Zip delivery from Security -> Settings. Scroll all the way down and there is a check box called PDF and ZIP files delivery. Once enabled, your link should work.

    Also note, if you have strict transformations (https://cloudinary.com/documentation/control_access_to_media#strict_transformations) enabled then only transformations pre-generated securely OR accessed via a signed URL will work OR if you explicitly allow this transformation for strict. This does not seem to be your issue but just mentioning for future use-cases.

    Please let me know if you have any other questions or queries.

    Kind Regards,

    Thomas