Skip to main content

安裝

Find the anon key with npx @insforge/cli secrets get ANON_KEY, or in the dashboard: click Install and open API Keys.

from()

取得儲存空間貯體例項以進行檔案操作。

參數

  • bucketName (string, required) - 儲存空間貯體的名稱

傳回

範例


upload()

使用特定路徑/金鑰上傳檔案。

參數

  • path (string, required) - 檔案的物件金鑰/路徑
  • file (File | Blob, required) - 要上傳的檔案或 Blob

傳回

上傳至現有物件金鑰會取代目前的物件。如需自動產生唯一金鑰,請使用 uploadAuto()

範例

輸出


uploadAuto()

使用自動產生的唯一金鑰上傳檔案。

參數

  • file (File | Blob, required) - 要上傳的檔案或 Blob

傳回

範例

輸出


download()

將檔案下載為 Blob。

參數

  • path (string, required) - 要下載的物件金鑰/路徑

傳回

範例

輸出


remove()

從儲存空間刪除檔案。

參數

  • path (string, required) - 要刪除的物件金鑰/路徑

傳回

範例

輸出