QQ小程序 qq.cloud.getTempFileURL

2020-07-10 17:49 更新

用云文件 ID 換取真實(shí)鏈接,公有讀的文件獲取的鏈接不會(huì)過期,私有的文件獲取的鏈接十分鐘有效期。一次最多取 50 個(gè)。

參數(shù)

字段 類型 必填 說明
fileList <Array>.string 要下載的文件 ID 組成的數(shù)組

fileList

字段 類型 必填 說明
fileID string 文件 ID
maxAge Integer 文件鏈接有效期

返回值

Promise.<Object>

屬性 類型 說明
fileList Object 文件列表

fileList 的結(jié)構(gòu)

屬性 類型 說明
fileID String 文件 ID
tempFileURL String 臨時(shí)文件路徑
status Number 狀態(tài)碼,0 為成功
errMsg String 成功為 ok,失敗為失敗原因

小程序端示例

qq.cloud
  .getTempFileURL({
    fileList: [
      {
        fileID: "a7xzcb",
        maxAge: 60 * 60 // one hour
      }
    ]
  })
  .then(res => {
    // get temp file URL
    console.log(res.fileList);
  })
  .catch(error => {
    // handle error
  });
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)