[英]How to download a file as Blob from google drive using API
我一直在研究一個代碼,它將使用他們的 API(V3)從谷歌驅動器下載一個 blob。 我想讓這個工作,因為我需要使用 fileUrl/fileID 將文件從谷歌驅動器復制到 firebase 存儲。
在關注medium上的博客后,我能夠導出 pdf 文件
為此,您需要:
webContentLink
並打開它以下載文件。 如果您要使用 curl,您將獲得文件內容。// 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!');
});
希望這可以幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.