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 — Problems writing to directory within bucket · Issue #2319 · googleapis/google-cloud-node

Problems writing to directory within bucket #2319

New issue
Copy link
New issue
Copy link
Closed
Closed
Problems writing to directory within bucket#2319
Copy link
Assignees
stephenplusplus
Labels
api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Description

@riescorp-iharrison
riescorp-iharrison
opened on May 17, 2017
Issue body actions

I can't seem to upload a file to a folder within a bucket.

var bucket = gcs.bucket('my_bucket/test/');

bucket.upload('hello.txt', function(err, file) {
  if (!err) {
    console.log("success");
  }else{
    console.log(err);
  }
});

This throws ApiError: Not Found

Am I doing this right? It works when I don't try to put it inside the folder.

Reacted by ngwanzhen

Activity

  1. riescorp-iharrison
    changed the title [-]Problems writing to directory withing bucket[/-] [+]Problems writing to directory within bucket[/+] on May 17, 2017
  2. stephenplusplus commented on May 17, 2017

    @stephenplusplus
    stephenplusplus
    on May 17, 2017
    Contributor
    More actions

    Good question! Technically, the Bucket name is the first part, "my_bucket". The file name can have a simulated directory structure by including the "path" in its name. So, basically:

    var bucket = gcs.bucket('my_bucket')
    
    bucket.upload('hello.txt', {
      destination: 'test/hello.txt'
    }, function...
    

    Or to reference the file directly:

    var bucket = gcs.bucket('my_bucket')
    var file = bucket.file('test/hello.txt')
    
    Reacted by riescorp-iharrison and ngwanzhen
  3. stephenplusplus
    closed this as completedon May 17, 2017
  4. stephenplusplus
    added
    api: storageIssues related to the Cloud Storage API.
    type: questionRequest for information or clarification. Not an issue.
    on May 17, 2017
  5. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  6. sofisl
    added 2 commits that reference this issue on Feb 26, 2026

    feat: add metrics tracers (#2319)

    40a85a9

    chore(main): release 8.1.0 (#2305)

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

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

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.