ファイルのダウンロード
download()メソッドを呼び出すことで、File Store内の既存のフォルダーからファイルをダウンロードできます。この操作は、ファイルが保存されている一時URLを返します。
以下のコードで使用されている<FILE_INSTANCE>は、サンプルコードスニペットに示すように、特定のファイルに対して作成されたインスタンスです。これは、一意のファイルIDによってダウンロードする必要がある特定のフォルダーからのファイルを参照します。
copy
<FILE_INSTANCE>.download(
success: (InputStream) → Unit,
failure: ((ZCatalystException) → Unit)?,
progress: ((Long, Long, Double) → Unit)?
): ZCatalystRequest<ResponseBody>?
以下にサンプルコードスニペットを示します:
copy
ZCatalystApp.getInstance().getFileStoreInstance().getFolderInstance(2823000000006561).getFile(2823000000044005, //これをあなたのフォルダIDに置き換えてください and File ID
{
file -> file.download(
{
println("File download success ${it.available()}")
},
{
println("File download failed $it")
},
{ bytesWritten, contentLength, percentage ->
println(">> Percentage - $percentage")
println(">> Bytes Written - $bytesWritten")
println(">> Content Length - $contentLength")
}
)
})
最終更新日 2026-03-24 17:38:39 +0530 IST
Yes
No
Send your feedback to us
Skip
Submit