コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
8419 ビュー

Hi, Everyone,

I used the code:

with open('z.jpg','wb') as f:
f.write(base64.b64decode(self.file))

the 'file' is the name of Binary field which have put a photo in, but I can't open the file (z.jpg) I have got correctly.

So, Are there anyone can modify this code and make it work?

アバター
破棄
著作者 最善の回答

I fixed with code:

with open('z.jpg','wb+') as f:
f.write(base64.b64decode(self.file))
アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 16
4076
0
5月 20
4567
0
10月 24
5177
1
4月 17
5164