File type is missing in the URL for raw files

Comments

3 comments

  • Avatar
    Eric Pasos

    Hi Gowtham,

    The format is dependent on the extension of the file being uploaded to your Media Library account. For example:

    cloudinary.uploader.upload("https://res.cloudinary.com/dnjnqvjbi/raw/upload/v1658357176/6bf8544f-ac67-4353-98fe-318b4e798354-CV_1658357175698", public_id="6bf8544f-ac67-4353-98fe-318b4e798354-CV_1658357175698", resource_type="raw")
    In the case that you want to provide this information, you can add the filename extension or you may use the `format` parameter, and this value will become the extension of the asset filename. For example:
     
    cloudinary.uploader.upload("https://res.cloudinary.com/dnjnqvjbi/raw/upload/v1658357176/6bf8544f-ac67-4353-98fe-318b4e798354-CV_1658357175698", format="docx", public_id="6bf8544f-ac67-4353-98fe-318b4e798354-CV_1658357175698", resource_type="raw")
    Hope this helps. Please let me know if you have any further questions.
     

     

    0
    Comment actions Permalink
  • Avatar
    Gowtham Ravichandran

    Hey Eric,

    Thanks for your quick response.

    I tried setting the format option in the URL. When I use the format option, the filename is stored in the Cloudinary as <example>.docx.docx and if I remove the format, the filename is stored as <example>.

    I am passing the file with the extension. Could you please help?

    Thanks in adavnce!

    0
    Comment actions Permalink
  • Avatar
    Eric Pasos

    Hi Gowtham,

    It is also possible to provide the extension of the file without using the parameter format, for example:

    cloudinary.uploader.upload("c:\samplefile.doc", public_id="samplepublicid", resource_type="raw")

    But just to check further, could you please help to provide a sample upload code that you used and also a sample *.docx file that has this duplicated extension?

    0
    Comment actions Permalink

Please sign in to leave a comment.