Python 2.7 has reached end of support and will be deprecated on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7 applications, even if your organization previously used an organization policy to re-enable deployments of legacy runtimes. Your existing Python 2.7 applications will continue to run and receive traffic after their deprecation date. We recommend that you migrate to the latest supported version of Python.

google.appengine.api.files.gs module

Summary

Files API.

Deprecated since version 1.8.1: Use Google Cloud Storage Client library instead.

Google Storage specific Files API calls.

Contents

google.appengine.api.files.gs.create(filename, mime_type='application/octet-stream', acl=None, cache_control=None, content_encoding=None, content_disposition=None, user_metadata=None)source

Create a writable googlestore file.

Parameters
  • filename – Google Storage object name (/gs/bucket/object)

  • mime_type – Blob content MIME type as string.

  • acl – Canned acl to apply to the object as per: https://cloud.google.com/storage/docs/xml-api/reference-headers#xgoogacl If not specified (or set to None), default object acl is used.

  • cache_control – Cache control header to set when serving through Google storage. If not specified, default of 3600 seconds is used.

  • content_encoding – If object is compressed, specify the compression method here to set the header correctly when served through Google Storage.

  • content_disposition – Header to use when serving through Google Storage.

  • user_metadata – Dictionary specifying key value pairs to apply to the object. Each key is prefixed with x-goog-meta- when served through Google Storage.

Returns

A writable file name for a Google Storage file. This file can be opened for write by File API open function. To read the file call file::open with the plain Google Storage filename (/gs/bucket/object).

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年06月16日 UTC.