我想从Google应用程序引擎应用程序访问我的计算机中的文件。如果我将该文件放在应用程序的src文件夹中,则没有问题,但我需要此文件超出该文件夹。IOError:[Errno 13]文件无法访问GAE
当我尝试访问该文件,我得到了一个错误:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 712, in __call__
handler.post(*groups)
File "C:\Users\path\Documents\path\oauth2client\appengine.py", line 469, in check_oauth
return method(request_handler, *args, **kwargs)
File "C:\Users\path\Documents\path\myapp.py", line 88, in post
filename=open('C:/Users/path_to_file/Documento 1.docx','r')
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 635, in __init__
raise IOError(errno.EACCES, 'file not accessible', filename)
IOError: [Errno 13] file not accessible: 'C:/Users/path_to_file/Documento 1.docx'
我已阅读,如果一个文件被app.yaml中定义为静态无法从GAE访问。这是我的app.yaml。我想不通,如果有什么错误:
application: myapp
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: myapp.py
这是一种尝试访问该文件的应用程序的一部分:
filename='C:/Users/path_to_file/Documento 1.docx'
media_body = MediaFileUpload(filename,resumable=True)
是否有人知道为什么我会得到“文件不可访问“错误?
谢谢!
的可能重复[ IOError:\ [Errno 13 \]文件无法通过Google AppEngine 1.6.1访问](http://stackoverflow.com/questions/8799304/ioerror-errno-13-file-not-accessible-with-google-appengine-1 -6-1) – bain