Firebase Storage中downloadURL与downloadURLs:是否为文档笔误?
downloadURL a typo for downloadURLs in Firebase Storage? Great question! This isn't a typo at all—it's a difference rooted in Firebase Storage's SDK evolution and use cases. Let me break it down clearly:
Legacy SDKs (Web v8 and older, older mobile SDKs)
In earlier versions of Firebase Storage's client SDKs, file metadata included thedownloadURLsproperty, which was an array of strings. This design existed because a single storage object could have multiple valid download URLs (for example, links generated with different temporary access tokens or custom security rules).Modern Modular SDKs (Web v9+)
The official workflow has shifted here. Instead of pulling download links from metadata, you now use thegetDownloadURL()method (likegetDownloadURL(storageRef)in Web v9) to fetch a single direct download URL. If you seedownloadURLreferenced elsewhere, it's almost always a developer's shorthand—either grabbing the first element from the olddownloadURLsarray, or a custom wrapper for the modern method's result.Admin SDK
For server-side operations with the Firebase Admin SDK,downloadURLsis still the correct property name in file metadata, and it remains an array. This is because the Admin SDK can generate multiple tokenized download links for a single file, supporting different access scenarios.
So to recap: downloadURLs is the official, documented property name for array-based download links in older and Admin SDKs, while downloadURL is a common unofficial shorthand for a single link. No typo involved!
内容的提问来源于stack exchange,提问作者Thomas David Kehoe

