跳至內容
選單
此問題已被標幟
1 回覆
9163 瀏覽次數

values = {

            'name': 'sample.txt',

            'datas_fname': 'sample.txt',

            'res_model': 'ir.ui.view',

            'res_id': False,

            'type': 'binary',

            'public': True,

            'datas': file_data.encode('utf8').encode('base64'),

        }


All the data are in one line even when I put \n on each line. someone suggested to decode it but I don't know how to decode.

頭像
捨棄
最佳答案

Please tell me when you got the answer for this

頭像
捨棄
作者

Hello! I got an answer to this, if your using linux, use \r\n instead of \n only. Because there are different way of doing next line depending on OS you use.

相關帖文 回覆 瀏覽次數 活動
1
9月 17
5611
2
6月 16
9948
0
9月 17
5345
0
2月 16
5122
9
11月 19
11616