uploadToPrivate method
Uploads the selected file directly to the storage's private folder.
Pass [relativeDirPath] the relative path (within the private folder) of the folder where you want to upload the file.
After uploading, the private URL is returned after the upload.
You can also specify the maximum vertical and horizontal size of the image by passing limitSize.
This value is applied if PickerMasamuneAdapter.forceImageResize is true.
ピックアップしたファイルを直接ストレージのprivate/userIdフォルダにアップロードします。
relativeDirPathにファイルをアップロードしたいフォルダの相対パス(private/userIdフォルダ内)を渡してください。
アップロードした後、アップロード後の非公開URLが返されます。
またlimitSizeを渡すことで、画像の縦および横の最大サイズを指定することが可能です。
PickerMasamuneAdapter.forceImageResizeがtrueの場合、この値が適用されます。
Implementation
Future<Uri> uploadToPrivate(String userId,
{String relativeDirPath = "", int? limitSize}) {
if (userId.isEmpty) {
throw Exception("User ID is empty.");
}
return upload(
relativeDirPath:
"private/${userId.trimQuery().trimString("/")}/${relativeDirPath.trimStringLeft("/")}",
limitSize: limitSize,
);
}