GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Is gzip uploading possible through the API · Issue #751 · googleapis/google-cloud-node

Is gzip uploading possible through the API #751

New issue
Copy link
New issue
Copy link
Closed
Closed
Is gzip uploading possible through the API#751
Copy link
Assignees
MKHenson
Labels
api: storageIssues related to the Cloud Storage API.

Description

@MKHenson
MKHenson
opened on Jul 28, 2015
Issue body actions

Hi guys

I have been reading the documentation and from what I understand there is functionality to gzip uploaded files to storage - or at least the functionality exists through the gsutil.

"Note also that gsutil provides an easy way to cause content to be compressed and stored with Content-Encoding: gzip: see the -z option"

Is this currently possible through the node API? I have not seen it mentioned in the docs or code comments. If not, does this mean we have to gzip the files ourselves and then upload it with gzip meta data?

Activity

Next
  1. stephenplusplus commented on Jul 28, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 28, 2015
    Contributor
    More actions

    we have to gzip the files ourselves and then upload it with gzip meta data?

    Yes. It would look something like:

    var fs = require('fs');
    var zlib = require('zlib');
    
    var file = bucket.file('file.gz');
    var writeStream = file.createWriteStream({
      metadata: {
        contentEncoding: 'gzip'
      }
    });
    
    fs.createReadStream('./file')
      .pipe(zlib.createGzip())
      .pipe(writeStream);

    Using the stream implementation, it's easy to attach a GCS writable stream to any data manipulation pipeline. However, it wouldn't be a big task to support this more easily in our library. I'll let others chime in.

    Thanks for the question!

  2. stephenplusplus
    added
    enhancement
    api: storageIssues related to the Cloud Storage API.
    on Jul 28, 2015
  3. MKHenson commented on Jul 28, 2015

    @MKHenson
    MKHenson
    on Jul 28, 2015
    Author
    More actions

    Thanks stephenplusplus, that makes sense to me. I'll go ahead and close the issue. Might not be worthwhile as a feature, but perhaps a mention in the docs? Just an afterthought though :)

  4. MKHenson
    closed this as completedon Jul 28, 2015
  5. jgeewax commented on Jul 28, 2015

    @jgeewax
    jgeewax
    on Jul 28, 2015
    Contributor
    More actions

    How common is gzipping ? If it's something people often want to do, is there a way we could simplify this ? So that it's much less code?

    Ideally, uploading a .gz version of a file would be the same number of lines (with an extra config or different method call) as uploading the uncompressed version.

  6. stephenplusplus commented on Jul 28, 2015

    @stephenplusplus
    stephenplusplus
    on Jul 28, 2015
    Contributor
    More actions

    It's probably common enough to make it easier. I'll send a PR.

  7. stephenplusplus
    reopened this on Jul 28, 2015
  8. callmehiphop
    closed this as completedin #753on Jul 28, 2015
  9. JustinBeckwith
    assigned
    MKHenson
    on Feb 1, 2021
  10. sofisl
    added a commit that references this issue on Nov 10, 2022

    docs(node): support "stable"/"preview" release level (#1312) (#751)

    9d43974
  11. gcf-owl-bot
    added a commit that references this issue on Nov 19, 2022

    feat: Update Compute Engine API to revision 20221101 (#751)

    9278592
  12. bcoe
    added a commit that references this issue on Dec 5, 2022

    feat: Update Compute Engine API to revision 20221101 (#751) (#3673)

    6da677a
  13. gcf-merge-on-green
    added a commit that references this issue on Dec 16, 2022

    chore: release main (#3529)

    a6b3e1f
  14. miguelvelezsa
    added a commit that references this issue on Jul 23, 2025

    chore(deps): update dependency @types/rimraf to v3 (#751)

    2513bd6
  15. 6 remaining items

  16. sofisl
    added a commit that references this issue on Jan 28, 2026

    build(node): do not throw on deprecation (#1140) (#751)

    72c25d3
  17. miguelvelezsa
    added a commit that references this issue on Jan 28, 2026

    fix: do not modify options object, use defaultScopes (#751)

    9ae85db
  18. sofisl
    added 4 commits that reference this issue on Jan 29, 2026

    build(node): do not throw on deprecation (#1140) (#751)

    283bb23

    build(node): do not throw on deprecation (#1140) (#751)

    1036e8c

    migrate code from googleapis/cloud-profiler-nodejs (#7087)

    288deb4

    fix: do not modify options object, use defaultScopes (#751)

    e57fecb
  19. sofisl
    added a commit that references this issue on Feb 17, 2026

    fix: do not modify options object, use defaultScopes (#751)

    ced57f9
  20. sofisl
    added a commit that references this issue on Feb 25, 2026

    feat: hmac service account (#751)

    bdeb9e8
  21. GautamSharda
    added 2 commits that reference this issue on Mar 5, 2026

    chore: remove snippet leading whitespace (#751)

    561538e

    fix(deps): update dependency teeny-request to v8 (#751)

    d1e9848
  22. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    feat: hmac service account (googleapis#751)

    e093198
  23. GautamSharda
    added 2 commits that reference this issue on Mar 23, 2026

    build: add config .gitattributes (#751)

    2d90568

    build: add config .gitattributes (#751)

    470c8ea
  24. shivanee-p
    added a commit that references this issue on Mar 27, 2026

    build: add config .gitattributes (#751)

    ffb683f
  25. thiyaguk09
    added a commit that references this issue on May 5, 2026

    build: add config .gitattributes (googleapis#751)

    697cabe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @MKHenson
    MKHenson

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.