简体   繁体   English

将 Firebase 存储文件夹下载到 Cloud Functions 临时文件夹

[英]Download Firebase Storage folder to a Cloud Functions Temporary Folder

I'm trying to download the entire folder from Firebase Storage so I can zip those files and upload them back to Firebase Storage while generating a download link.我正在尝试从 Firebase 存储下载整个文件夹,这样我就可以 zip 这些文件并将它们上传回 Firebase 存储,同时生成下载链接。

I have read a lot of posts and code but everything seemed getting away from my scope.我已经阅读了很多帖子和代码,但一切似乎都远离了我的 scope。

Do you have a clear example on how to download a Firebase Storage Folder to a Cloud Functions Temporary Folder or at least some hints on I could do it, keeping in mind that I am targeting a specific folder?您是否有关于如何将 Firebase 存储文件夹下载到 Cloud Functions 临时文件夹的明确示例,或者至少有一些关于我可以做到的提示,请记住我的目标是特定文件夹?

There is no bulk download operation provided by the SDK. SDK不提供批量下载操作。 The general pattern for downloading all files with some shared prefix using the node SDK for Cloud Storage will be:使用用于 Cloud Storage 的节点 SDK 下载具有某些共享前缀的所有文件的一般模式将是:

  1. list the files using getFiles at the prefix (folder) of interest在感兴趣的前缀(文件夹)处使用 getFiles 列出文件
  2. iterate them迭代它们
  3. download each one separately分别下载每一个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Firebase云功能删除用户存储文件夹 - Remove users storage folder with firebase cloud functions 如何使用Firebase云功能存储创建文件夹 - How can make folder with Firebase Cloud Functions Storage 使用下载 url 和 Cloud Functions 从 Firebase 存储中删除文件 - Delete a file from firebase storage using download url with Cloud Functions Firebase存储错误的云功能 - Cloud Functions for Firebase Storage Error 如何清除Firebase Cloud Functions中的临时文件 - How to clean temporary files in Firebase Cloud Functions 如何在 Google Cloud Function 的 /tmp 文件夹中下载文件,然后将其上传到 Google Cloud Storage - How to download files in /tmp folder of Google Cloud Function and then upload it in Google Cloud Storage 通过 Firebase 函数下载文件到 Firebase 存储 - Download file to Firebase Storage via Firebase Functions 如何使用云功能制作缩略图并将其放置在Firebase存储中的特定文件夹中? - how to make thumbnail and place it in the particular folder in Firebase storage using cloud function? 如何从云功能访问 firebase 存储中的特定文件夹? - How can I access a specific folder inside firebase storage from a cloud function? Cloud Function 存储在特定 Bucket 文件夹上的触发器 - Cloud Function storage trigger on folder of a particular Bucket
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM