Y
Y
Yoptr2018-03-01 11:20:53
Database design
Yoptr, 2018-03-01 11:20:53

Does it make sense to store media files on the server as base64?

I am designing a simple homemade backend.
Does it make sense to store media files on the server as base64?
Do they do that?
Does it happen in life?
About a 30% increase in size I know - this is not a problem.
In what cases is it more convenient to use files and in what base64?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Y
Yerlan Ibraev, 2018-03-02
@ffhhttee

Base64 can only be used for transfer when files are "wrapped" in JSON or XML.
In other cases, it is better to store / transfer them as is.
Base64 - This is a format for transferring binary files as text, so the data "swells" a lot.
But this is sometimes needed when the receiving side expects text as input, not binary data.

I
Igor Karachentsev, 2018-03-01
@kucheriavij

What's the point? Why not write the file physically, but store it in the database? Then the base will be inflated, and very strongly. Plus, performance will suffer, since it will be necessary to encode this file first, and then decode it to the browser before outputting it. Basically, it's completely pointless.

V
Vladimir Skibin, 2018-03-01
@megafax

This is only applicable for downloadable files, for ordinary assets - it really makes no sense

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question