Can't Upload Files To Root Location

Options
angora
angora Member Posts: 2
edited May 20 in Developer APIs

I have 3 files with same name and different format:

• favicon.ico

• favicon.png

• favicon.svg

But I can't upload all of them because everytime I upload the newer file it replace the older file.

Also I can't embed svg format into my website. Any solution?

Answers

  • Wissam
    Wissam Member, Cloudinary Staff Posts: 76
    Options

    Hi @angora ,

    Once uploading the files through the media library without any default upload preset, the default is overwrite:true. I would suggest creating an upload preset with the Unique filename: true

    To create such an upload preset please follow these steps:

    1. From the settings page, go to the upload tab.
    2. Scroll down to the 'Preset' section and click 'Add upload preset'.
    3. From the 'Storage and access' tab you will see an option of 'Use filename or externally defined public ID'. You will need to switch that 'On'. Once this is on, the option of 'Unique Filename' will appear just below - this will need to be 'On'. Once this step is completed please click on the Orange 'save' button at the top of the page.
    4. Going back to the upload tab in the settings page, you can set this upload preset as the default upload option for images, videos and/or raw files when using the Media Library.

    More information about setting an upload preset can be found here: https://support.cloudinary.com/hc/en-us/articles/208097215-How-can-I-add-upload-options-when-uploading-via-the-Media-Library-


    Regarding your second question: I can't embed svg format into my website. Any solution?

    To embed an SVG into your HTML, use the <img> tag with the Cloudinary URL as the src attribute, for example:
    <img src="https://res.cloudinary.com/<your-cloud-name>/image/upload/image.svg" alt="Your SVG" />

    If you want to display it in the browser by accessing it directly then our main recommendation is that you apply the 'sanitize' flag to your SVG URLs, and display it 'inline' if there are no scripts, etc using fl_sanitize.

    For example: https://res.cloudinary.com/<your-coud-name>/image/upload/fl_sanitize/image.svg

    I hope you find it useful.
    Please let me know if you have additional questions.

    Regards,

    Wissam

  • angora
    angora Member Posts: 2
    Options