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 — support globs in `upload` · Issue #412 · googleapis/google-cloud-node

support globs in upload #412

New issue
Copy link
New issue
Copy link
Closed
Closed
support globs in upload#412
Copy link
Assignees
stephenplusplus
Labels
🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.
Milestone
Storage Future

Description

@raitucarp
raitucarp
opened on Feb 24, 2015
Issue body actions

I have error Error: EISDIR

Is it relevance with upload folder features?
Can I request that feature? if not, could you explain me why?

Thanks

Activity

Next
  1. ryanseys
    added
    enhancement
    api: storageIssues related to the Cloud Storage API.
    on Feb 24, 2015
  2. ryanseys
    added this to the Storage Future milestone on Feb 24, 2015
  3. ryanseys commented on Feb 24, 2015

    @ryanseys
    ryanseys
    on Feb 24, 2015
    Contributor
    More actions

    Thanks for your suggestion! I believe we may be able to support such a feature. Something like this might be sufficient:

    var opts = { recursive: true, validation: true, resumable: true };
    bucket.uploadFolder('./photos', opts, function(errs, files) {
      // errs is null if no errors occur on any files
      // errs is array of errors for every file that fails to upload
      // files is every file that succeeds in uploading
    });

    The only issue I can see with this is that it will be hard to measure progress of such uploads (which could be long running) without any sort of stream interface. We might be able to do some sort of "progress stream" like:

    var progress = bucket.uploadFolder(/* ... */);
    progress.on('error', errCallback);
    progress.on('fileEnd', aSingleFileDoneCallback);
    progress.on('end', allFilesDoneCallback);

    Until then you could probably get by with something like this which should in theory upload all files in a particular folder (non-recursively):

    var fs = require('fs');
    var async = require('async'); // npm install async
    var bucket = storage.bucket('my-bucket'); // need to inititialize storage beforehand (see docs)
    var contents = fs.readdirSync('./path/to/folder'); // get contents of folder (files and folders)
    var files = contents.filter(function(file) {
      return fs.statSync(file).isFile(); // filter out only files
    });
    async.each(files, function(file, cb) {
      bucket.upload(file, cb);
    }, function(err) {
      // all files should be uploaded now assuming there were no errors!
    });
  4. stephenplusplus commented on Feb 24, 2015

    @stephenplusplus
    stephenplusplus
    on Feb 24, 2015
    Contributor
    More actions

    I don't mind the idea, though we would just be doing what the user could do in their code (1. get a list of files in a directory, 2. send each file to bucket.upload).

    To handle this more easily, we could support glob input to allow more specificity: bucket.upload("backups/*.jpg", ...

  5. stephenplusplus commented on Feb 24, 2015

    @stephenplusplus
    stephenplusplus
    on Feb 24, 2015
    Contributor
    More actions

    The only issue I can see with this is that it will be hard to measure progress of such uploads (which could be long running) without any sort of stream interface.

    That example looks good to me, though I would nit-pickingly change fileEnd to file-uploaded.

  6. ryanseys commented on Feb 24, 2015

    @ryanseys
    ryanseys
    on Feb 24, 2015
    Contributor
    More actions

    Yeah, sure! That was just an example 😃 If it happened that way we might decide to have more events too.

  7. raitucarp commented on Feb 24, 2015

    @raitucarp
    raitucarp
    on Feb 24, 2015
    Author
    More actions

    OK. @stephenplusplus I catch the clue. Thanks for such suggestion 👍

  8. stephenplusplus
    changed the title [-]Add support to upload folder?[/-] [+]support globs in `upload`[/+] on Mar 31, 2015
  9. stephenplusplus commented on Jun 8, 2015

    @stephenplusplus
    stephenplusplus
    on Jun 8, 2015
    Contributor
    More actions

    I got it in my head that supporting globs would be a good idea, but after an attempt at an implementation, it felt like more weight than our library should handle. If anyone objects, feel free to discuss!

  10. stephenplusplus
    closed this as completedon Jun 8, 2015
  11. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Apr 6, 2020
  12. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  13. chingor13
    added a commit that references this issue on Aug 22, 2022

    feat: add AnalyzeIamPolicy and AnalyzeIamPolicyLongrunning RPCs (#412)

    755dc16
  14. 28 remaining items

  15. sofisl
    added 2 commits that reference this issue on Jan 27, 2026

    chore(deps): update dependency mocha to v6 (#412)

    590bb26

    chore(deps): update dependency mocha to v6 (#412)

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

    chore: use published jsdoc-baseline package (#412)

    4df08e4
  17. GautamSharda
    added a commit that references this issue on Feb 2, 2026

    chore: use c8 and re-format (#412)

    7e64cd9
  18. sofisl
    added a commit that references this issue on Feb 3, 2026

    fix: remove teeny-request as a direct dependency (#412)

    5d8f94d
  19. GautamSharda
    added a commit that references this issue on Feb 3, 2026

    chore: use c8 and re-format (#412)

    29ba63d
  20. sofisl
    added 3 commits that reference this issue on Feb 4, 2026

    fix: update HttpRequest to match @google-cloud/logging (#412)

    5f7c431

    chore: release 3.0.0 (#441)

    b53db13

    chore: use published jsdoc-baseline package (#412)

    f6ad4aa
  21. sofisl
    added a commit that references this issue on Feb 17, 2026

    chore: use published jsdoc-baseline package (#412)

    f7ac8f7
  22. sofisl
    added a commit that references this issue on Feb 25, 2026

    Don't publish sourcemaps (#412)

    65785bc
  23. GautamSharda
    added a commit that references this issue on Mar 5, 2026

    refactor: index.ts to async-first (#412)

    b7401d7
  24. sofisl
    added a commit that references this issue on Mar 5, 2026

    chore: migrate code from googleapis/gcp-metadata (#53)

    fa9a454
  25. GautamSharda
    added a commit that references this issue on Mar 12, 2026

    build!: upgrade engines field to >=8.10.0 (#412)

    9130a08
  26. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    Don't publish sourcemaps (googleapis#412)

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

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    • Storage Future

    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.