Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何使用API从google drive下载Blob文件_Node.js_Google Drive Api_Filesystems_Firebase Storage - Fatal编程技术网

Node.js 如何使用API从google drive下载Blob文件

Node.js 如何使用API从google drive下载Blob文件,node.js,google-drive-api,filesystems,firebase-storage,Node.js,Google Drive Api,Filesystems,Firebase Storage,我一直在编写一段代码,该代码将使用他们的API(V3)从谷歌硬盘下载一个blob。我想让它工作,因为我需要使用fileUrl/fileID将文件从google drive复制到firebase存储 我可以在浏览了上的博客后导出pdf文件。要执行此操作,您需要: 您可以获取webContentLink并打开它下载文件。如果将其卷曲,则会得到文件内容 希望这有帮助 // Create a root reference var storageRef = firebase.storage().re

我一直在编写一段代码,该代码将使用他们的API(V3)从谷歌硬盘下载一个blob。我想让它工作,因为我需要使用fileUrl/fileID将文件从google drive复制到firebase存储


我可以在浏览了

上的博客后导出pdf文件。要执行此操作,您需要:

  • 您可以获取
    webContentLink
    并打开它下载文件。如果将其卷曲,则会得到文件内容
  • 希望这有帮助

    // Create a root reference
    var storageRef = firebase.storage().ref();
    
    // Create a reference to 'mountains.jpg'
    var mountainsRef = storageRef.child('mountains.jpg');
    
     var file = ... // use the Blob you got on step 1
     ref.put(file).then(function(snapshot) {
       console.log('Uploaded a blob or file!');
     });