İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
8078 Görünümler

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?

Avatar
Vazgeç
Üretici En İyi Yanıt

I fixed with code:

with open('z.jpg','wb+') as f:
f.write(base64.b64decode(self.file))
Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Şub 16
3660
0
May 20
4052
0
Eki 24
4582
1
Nis 17
4632