0

我正在使用带有 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/g37923983991djkdjk‌​kajd==')  

更新

这不起作用:

blob = BlobService(account_name='xxx', account_key='O6asd7ET+ssadsadNvVLAZ46nB6iHDadavpKbJilKvy0uOJ4/g37923983991djkdjk‌​kajd==')  

 @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/g37923983991djkdjk‌​kajd==')  
                raw = blob.get_blob('picture', filename)
                return raw

为什么?并return raw给出套接字异常。

4

0 回答 0