I want to access a file in my computer from a google app engine application. If I put the file in the src folder of the application there is no problem but I need this file to be out of that folder.
When I try to access this file I get the next error:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\webapp\_webapp25.py", line 712, in __call__
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
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'
- url: /.*
media_body = MediaFileUpload(filename,resumable=True)
Put the file in the same directory as the rest of your applications files (i.e. where the app.yaml is).
All the files you want your application to access have to be in the same place, under your main application directory.
GAE can't access arbitrary files somewhere on your computer, just like it cannot access files saved "somewhere" else when deployed.
That's assuming it's in the 'root' (same as app.yaml).