Skip to content

storage: 404 not found after upload #340

Description

@pierre-b

Hi, right after uploading a file I need to get it back and Storage returns a 404:

fs.createReadStream('/local/photo.jpg').pipe(bucket.file('photo.jpg').createWriteStream().on('finish', function(){
  console.log('write finished');

  bucket.file('photo.jpg').createReadStream().pipe(fs.createWriteStream('/downloaded.jpg'));
}));

Is there a better callback to know when a file is fully uploaded to Storage please ?
Thanks

Activity

  1. pierre-b commented on Jan 5, 2015

    @pierre-b
    Author

    Thanks to @ngrilly the event is not "finish" but "complete":

    fs.createReadStream('/local/photo.jpg').pipe(bucket.file('photo.jpg').createWriteStream().on('complete', function(){
      console.log('write finished');
    
      bucket.file('photo.jpg').createReadStream().pipe(fs.createWriteStream('/downloaded.jpg'));
    }));
  2. stephenplusplus commented on Jan 5, 2015

    @stephenplusplus
    Contributor

    Glad you got this resolved! Thanks, @ngrilly!

  3. pierre-b commented on Jan 6, 2015

    @pierre-b
    Author

    @stephenplusplus An update of the docs would be nice ;)

  4. added
    api: storageIssues related to the Cloud Storage API.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Feb 2, 2015
  5. added this to the Storage Stable milestone on Feb 2, 2015
  6. 32 remaining items

  7. added a commit that references this issue on Feb 3, 2026
  8. added a commit that references this issue on Feb 5, 2026
  9. added a commit that references this issue on Feb 23, 2026
  10. added a commit that references this issue on Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: storageIssues related to the Cloud Storage API.triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions