如何將圖像上傳到 firebase 云存儲?文檔只提供了這些方法,但沒有提供上傳方法。這是文檔鏈接https://firebase-php.readthedocs.io/en/stable/cloud-storage.html$storage = $factory->createStorage();$storageClient = $storage->getStorageClient();$defaultBucket = $storage->getBucket();我看到了另一個相關的堆棧問題,但不明白答案。我還想獲得存儲文件的鏈接。先感謝您!
2 回答

慕碼人2483693
TA貢獻1860條經驗 獲得超9個贊
檢查官方 firebase文檔,如其中所述:
“要將文件上傳到云存儲,您首先要創建對文件完整路徑的引用,包括文件名。?”
例如:
// Create a root reference
var storageRef = firebase.storage().ref();
// Create a reference to 'mountains.jpg'
var mountainsRef = storageRef.child('mountains.jpg');
// Create a reference to 'images/mountains.jpg'
var mountainImagesRef = storageRef.child('images/mountains.jpg');
// While the file names are the same, the references point to different files
mountainsRef.name === mountainImagesRef.name? ? ? ? ? ? // true
mountainsRef.fullPath === mountainImagesRef.fullPath? ? // false
另外,我在這里找到了另一個線程,您可以在其中找到使用 php 的示例

德瑪西亞99
TA貢獻1770條經驗 獲得超3個贊
- 2 回答
- 0 關注
- 138 瀏覽
添加回答
舉報
0/150
提交
取消