Odoo files store and base64 encoding

Odoo files store

Default since odoo 11 may be 10

By default, starting from version 11 of the ode, all files are stored on the server's FILE SYSTEM. The database stores only the names of the files. The names are hashed by the sha-512 algorithm, which is why we see such incomprehensible names on the server.

Store

But if we add an extension to such files for example .jpg and try to open then they will open successfully. Naturally, if the file itself is jpg, then the extension must be selected from the content of the file

Why base64

base64 on server and client

But then why do we always encrypt to base64 first and then decrypt?

this is due to the fact that in web technologies, for example, on an html page, you can display an image not only with a url, but also with base64 data. For example, in the img tag, we can not specify the url of the image, but specify the image itself in base64 and it will be displayed.
Also it can be related with import, export odoo feature.

This is how the standard image widget in odoo works.

When we upload an image, we actually read it in base64 and then add this code to the Img tag. And the picture is displayed as if we uploaded it, in fact everything happened locally. And even the picture was not transmitted over the network. But when we click the save button, then the picture will go to the server

Sign in to leave a comment
Odoo speedup website with minify
Top secrets