我正在使用带有天蓝色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
给出套接字异常。