File extensions disappear other than image and pdf files?

Options
medicasimple
medicasimple Member Posts: 1
edited June 2023 in Developer APIs

Hi there all of you guys.


I am trying to upload some files to cloudinary but other than pdf files, extensions disappear and I can not download properly these files.


I am using "resource_type:auto" and also "resource_type:raw" parameters but it didn't help me.


I am sure that files are properly stored because change its name and add its extensions by hand give me the original file correctly.


I also tried to use "format" parameter but for instance .xlsx or .html files does not seen under upload_result - format parameter.


I hope I can explain myself correctly. I added some screenshots too.


Thank you for helping me

.

Answers

  • Tom
    Tom Member, Cloudinary Staff Posts: 65
    Options

    Hi @medicasimple ,

    Thanks for reaching out.

    Yes, so when the resource_type of your asset is either image or video, the extension is not saved as part of the public_id as we know this is image/video.

    However, with raw files, the extension can be anything so include the extension in the public_id.

    Note: pdf's are automatically uploaded as resource_type image but you can specify this as raw if you would like to save it as raw resource_type.

    You should still be able to download images without an extension on image/video where when no extension is specified we will use the original format e.g. https://res.cloudinary.com/demo/image/upload/sample.jpg can be viewed/downloaded as https://res.cloudinary.com/demo/image/upload/sample

    If you are downloading via browser without the extension then it should automatically add the extension but when downloading via terminal (using wget), extension is not saved so you can copy the delivery URL from the UI/APIs as it will include the extension.

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

    Kind Regards,

    Thomas