我正在使用带有 azure blob 存储的瓶子 python:
@route('/download/:filename')
def getDownload(filename):
try:
raw = blob.get_blob('picture', filename)
return raw
我的代码下载文件是否正确?
编辑
您是如何实例化 blob 的,例如:
blob = BlobService(account_name, account_key)
?
blob = BlobService(account_name='xxx', account_key='O6asd7ET+ssadsadNvVLAZ46nB6iHDadavpKbJilKvy0uOJ4/g37923983991djkdjkkajd==')
更新
这不起作用:
blob = BlobService(account_name='xxx', account_key='O6asd7ET+ssadsadNvVLAZ46nB6iHDadavpKbJilKvy0uOJ4/g37923983991djkdjkkajd==')
@route('/download/:filename')
def getDownload(filename):
try:
raw = blob.get_blob('picture', filename)
return raw
这项工作部分:
@route('/download/:filename')
def getDownload(filename):
try:
blob = BlobService(account_name='xxx', account_key='O6asd7ET+ssadsadNvVLAZ46nB6iHDadavpKbJilKvy0uOJ4/g37923983991djkdjkkajd==')
raw = blob.get_blob('picture', filename)
return raw
为什么?并return raw
给出套接字异常。