Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
11040 Представления

i download product details from openerp. In that csv file i get image in binary format. When i try to upload data again some of the rows showing padding error ( Incorrect padding ). How to s solve this issue?

Аватар
Отменить
Автор

its a base64 decode error. i try to decode binary image value to .decode('base64') it show same error. how to solve this ?

Лучший ответ

When exporting images directly from PostgreSQL, convert PostgreSQL's bytea format to base64 using the following in the query:

select encode("product_product"."image",'base64') as "image" from "product_product";

Using .decode('base64') in Python will not work because the data first needs to be decoded from PostgreSQL's bytea format.

See also https://www.odoo.com/forum/help-1/question/export-external-id-directly-from-database-67297

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
мар. 18
3557
1
мар. 16
3488
2
мар. 15
10923
1
мар. 15
9119
0
февр. 23
2441