Unable to download file from google cloud storage with it's original name.

2,051 views
Skip to first unread message

Nagaraju Devisetti

unread,
Jul 4, 2018, 12:15:01 PM7/4/18
to Google App Engine
I am uploading the files to sub folders for identifying specific user files, but here file is downloading with path. 
I didn't find any solution for this. 

wang...@google.com

unread,
Jul 5, 2018, 11:34:14 AM7/5/18
to Google App Engine
Folders are used to help organize objects in the Cloud Storage, they do not actually exist in a hierarchical structure. Since the objects do not exist in subdirectories, the name of an object is the object name as well as the path to access the object. Depending on the method of downloading objects[3] you can rename the object to the desired name once it is downloaded, or to simply save it as the desired name to begin with.

Nagaraju Devisetti

unread,
Jul 9, 2018, 8:56:22 AM7/9/18
to Google App Engine
I have tried this but unable to download more than 30 mb file.

wang...@google.com

unread,
Jul 9, 2018, 4:19:04 PM7/9/18
to Google App Engine
There isn’t a Cloud Storage limit of 30 MB for downloading objects so downloading directly from Cloud Storage should not limit the download size to 30 MB. If you are downloading from App Engine there is a 32 MB limit so download the files from Cloud Storage to avoid this issue. 

Nagaraju Devisetti

unread,
Jul 10, 2018, 10:39:08 AM7/10/18
to Google App Engine
I am getting Read-only file system bug with cloud storage.

Traceback (most recent call last):
  File "C:\Program Files\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "C:\Program Files\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "C:\Program Files\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "C:\Program Files\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "F:\TABASCO\TAB-167\tabasco\user_accounts.py", line 274, in dispatch
    webapp2.RequestHandler.dispatch(self)
  File "C:\Program Files\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "C:\Program Files\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "F:\TABASCO\TAB-167\tabasco\main.py", line 4964, in get
    self.downloadPackage(pkg, DOWNLOAD_LIMIT, uri, to_download, folderdownload,data,recipientindex)
  File "F:\TABASCO\TAB-167\tabasco\main.py", line 5109, in downloadPackage
    file_blob.download_to_filename(str(file_info.name))
  File "C:\Python27\lib\site-packages\google\cloud\storage\blob.py", line 519, in download_to_filename
    with open(filename, 'wb') as file_obj:
  File "C:\Program Files\Google\google_appengine\google\appengine\tools\devappserver2\python\stubs.py", line 247, in __init__
    raise IOError(errno.EROFS, 'Read-only file system', filename)
IOError: [Errno 30] Read-only file system: 'bawarchi.jpg'

On Wednesday, July 4, 2018 at 9:45:01 PM UTC+5:30, Nagaraju Devisetti wrote:

diogoa...@google.com

unread,
Jul 10, 2018, 3:54:05 PM7/10/18
to Google App Engine
Most probably the issue is that your code may be using the open method, which sets the mode default to read-only.

Less likely, you are trying to save the file to the App Engine file system, which is a restriction documented here. App Engine sandboxed environment does not allow you to save in the file system. 

diogoa...@google.com

unread,
Jul 10, 2018, 3:54:05 PM7/10/18
to Google App Engine
Most probably the issue is that your code may be using the open method, which sets the mode default to read-only.

Less likely, you are trying to save the file to the App Engine file system, which is a restriction documented here. App Engine sandboxed environment does not allow you to save in the file system. 


Reply all
Reply to author
Forward
0 new messages