728x90
๋ฐ์ํ
import base64
imgdata = base64.b64decode(imgstring)
filename = 'some_image.jpg' # I assume you have a way of picking unique filenames
with open(filename, 'wb') as f:
f.write(imgdata)
# f gets closed when you exit the with statement
# Now save the value of filename to your database
์ถ์ฒ:
https://stackoverflow.com/questions/16214190/how-to-convert-base64-string-to-image/16214280
How to convert base64 string to image?
I'm converting an image to base64 string and sending it from android device to the server. Now, I need to change that string back to an image and save it in the database. Any help?
stackoverflow.com
728x90
๋ฐ์ํ
'๐จ๐ผโ๐ป๊ฐ๋ฐ > ํ์ด์ฌ' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
ํ์ด์ฌ - ini ์ค์ ํ์ผ ๋ถ๋ฌ์ค๊ธฐ (0) | 2022.05.08 |
---|---|
ํ์ด์ฌ - ์ค๋ ๋ ์๊ด ์์ด ํ๋ก๊ทธ๋จ ์์ ์ข ๋ฃ (0) | 2022.05.07 |
ํ์ด์ฌ - Cloudflare ์ฐํํ์ฌ ํฌ๋กค๋งํ๊ธฐ (0) | 2022.01.29 |
ํ์ด์ฌ - ์ฌ๋ฌ๊ฐ์ ๋ฌธ์์ด ๋ณ๊ฒฝํ๊ธฐ (0) | 2021.12.08 |
Flask - static ํ์ผ๋ค ์ ๊ณตํ๊ธฐ (0) | 2021.12.08 |