How to add SVG icons to Xano?

Options
I need help some here. 
Sorry if this is a basic question, but I could not find information about this anywhere.

I have a categories table where I need to add SVG icons, but when I try to add them to the storage/image field, it does not allow me to select SVG files.
Do I need to use a different field type for SVG? 

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    Svgs are all text- you could store the body directly in a field in your table. Is that a useful option for you?
  • Leon Barth
    Leon Barth Member
    Options

    I guess in the end everything is text @Ray Deck ;). And then numbers …

    —-
    I assume that attachments also work for SVG, right?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Any file can be attached - including SVG files. You don't get the metadata that goes with images or videos, but that should be fine.

    SVGs because they are 1) small and 2) made of text (as opposed to JPGs, which are binary) are also candidates to store directly in the database rather than in the file storage system without ceremony. So both techniques work

  • Gustavo Santos
    Options

    Hi @Ray Deck

    How to save the SVG on the text field? I just copy and past and only have the SVG title not the icon I wish to display.

    Maybe I'm doing something wrong.

    Regards

    Gustavo S

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    SVG is just text - it looks a lot like HTML. Then when you put it in the context of your web page, the browser renders it into an image. That text basis is what makes it a good fit for storing in a string field in a database.

  • Gustavo Santos
    Options

    I trying to put inside an App and not working like a webpage.

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Doesn't matter how you will use it - the SVG is still just a string. Try downloading one from, say, wikipedia, and then open it with your preferred text editor. Because it is a string, you can store it in a text field. The consumer - web browser, Swift app on iOS, whatever - will be responsible for taking the list of instructions and turning them into the visual representatino you are going for.

  • Gustavo Santos
    Options

    Hi Ray, for some reason it didn’t worked in Flutterflow when I run on iOS. I change the text field and put a image in png format and worked.

    Appreciate your support.

    Gustavo

  • Ale
    Ale Member
    Options

    I am in exactly the same situation and facing the same problem, were you able to find a solution?