Problem/Motivation

When uploading a PDF file using the Cloudinary module, the generated URL misses the .pdf extension. Consequently, when users click on the generated link, the file downloads without an extension instead of opening in a browser tab for viewing.

Steps to reproduce

  1. Install the Cloudinary module on a Drupal site.
  2. Configure the module with appropriate Cloudinary credentials.
  3. Upload a PDF file via the Cloudinary interface.
  4. Observe the generated URL for the uploaded PDF file.

Proposed resolution

Modify the Cloudinary module to ensure the .pdf extension is included in the generated URL for PDF files. This can be done by appending the file extension to the URL if it's missing.

Remaining tasks

  1. Update the module code to include the .pdf extension in the URL.
  2. Test the updated module to ensure the issue is resolved.
  3. Review and merge the code changes.

User interface changes

None expected.

API changes

None expected.

Data model changes

None expected.

Comments

bonrita created an issue. See original summary.

bonrita’s picture

The patch works but may need an extra touch. This was a quick fix.