Repository navigation
exists method for storage/bucket#file ? #914
Copy link
Copy link
Closed
Labels
Description
Activity
We don't have an exists method (yet/something like it/maybe) but this is what it would do:
file.getMetadata(function(err) { if (err.code === 404) { // doesn't exist } });
Reacted by Prashanth HN@stephenplusplus thanks! btw I think this should be added to the document or added as a method.
- I'm +1 for adding this as a method.....
I think
existsis a super simple shortcut aroundget-- so yea, I'd be 👍 to adding it to the list.existsexists! It will be released this week across all of our APIs (except Datastore for now).great!
发送自 Outlook
On Tue, Nov 17, 2015 at 11:16 AM -0800, "Stephen Sawchuk" [email protected] wrote:
Closed #914.
—
Reply to this email directly or view it on GitHub.- added a commit that references this issue
on Nov 11, 2022 - added a commit that references this issue
on Jul 23, 2025 - added 2 commits that reference this issue
on Jan 14, 2026 7 remaining items
- added 2 commits that reference this issue
on Jan 29, 2026 - added 2 commits that reference this issue
on Feb 2, 2026 - added a commit that references this issue
on Mar 5, 2026 - added a commit that references this issue
on Mar 18, 2026 - added 2 commits that reference this issue
on Mar 27, 2026
Currently I can't find a method to check if a file is already existed in the bucket.