import base64
path = '/home/a.pdf'
f = open(path, 'rb')
base64_str = base64.b64encode(f.read())
print(base64_str)
flask将文件以base64编码格式返回前端
PDF文件Base64编码
最新推荐文章于 2024-07-03 20:17:02 发布
本文介绍了一种将PDF文件转换为Base64编码字符串的方法,通过Python的base64模块实现,便于在网络中传输和存储。

5298





