Tôi muốn truy cập tệp trong máy tính của mình từ ứng dụng công cụ ứng dụng của google. Nếu tôi đặt các tập tin trong thư mục src của ứng dụng không có vấn đề nhưng tôi cần tập tin này được ra khỏi thư mục đó.IOError: [Errno 13] không thể truy cập tệp GAE
Khi tôi cố gắng truy cập vào tập tin này, tôi nhận được lỗi sau:
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'
Tôi đã đọc rằng nếu một tập tin được định nghĩa là tĩnh trong app.yaml không thể truy cập từ GAE. Đây là app.yaml của tôi. Tôi không thể tìm ra nếu có cái gì đó sai:
application: myapp
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: myapp.py
Và đây là một phần của ứng dụng mà cố gắng để truy cập file:
filename='C:/Users/path_to_file/Documento 1.docx'
media_body = MediaFileUpload(filename,resumable=True)
Không ai biết tại sao tôi nhận được " tệp không thể truy cập "lỗi?
Cảm ơn!
trùng lặp càng tốt này của [ Tệp IOError: \ [Errno 13 \] không thể truy cập được bằng Google AppEngine 1.6.1] (http://stackoverflow.com/questions/8799304/ioerror-errno-13-file-not-accessible-with-google-appengine-1 -6-1) – bain