Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
11001 มุมมอง

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
3553
1
มี.ค. 16
3475
2
มี.ค. 15
10915
1
มี.ค. 15
9106
0
ก.พ. 23
2405