isu*_*uru 19 javascript firebase firebase-storage
我想从Firebase存储中下载整个文件夹.单个文件可以通过如下获取DownloadURL来下载.但它对文件夹不起作用.
var storageRef = firebase.storage().ref();
// Create a reference to the file we want to download
var starsRef = storageRef.child(path);
// Get the download URL
starsRef.getDownloadURL().then(function(url) {
// Insert url into an <img> tag to "download"
ImageUrl = url;
console.log(ImageUrl);
}).catch(function(error) {
switch (error.code) {
case 'storage/object_not_found':
// File doesn't exist
break;
case 'storage/unauthorized':
// User doesn't have permission to access the object
break;
case 'storage/canceled':
// User canceled the upload
break;
case 'storage/unknown':
// Unknown error occurred, inspect the server response
break;
}
});
Run Code Online (Sandbox Code Playgroud)
如何从Firebase下载整个文件夹?
Lah*_*ima 24
您可以使用gsutil下载整个存储桶
gsutil -m cp -R gs://<bucket_name> .
Run Code Online (Sandbox Code Playgroud)
小智 6
Windows下的gustil命令!!!
gsutil cp -r gs://<bucket_name>.appspot.com/OBJECT_NAME "D:\path"
Run Code Online (Sandbox Code Playgroud)
使用适用于 PowerShell 的云工具
安装 Windows 的参考>> https://cloud.google.com/storage/docs/gsutil_install
| 归档时间: |
|
| 查看次数: |
12612 次 |
| 最近记录: |