I write app in Android Java and need to download file from Appwrite Cloud into custom directory. Firstly I need to test how it works, but my code don't downloading file.
currentQuizFileIdString,
new Continuation<Object>() {
@NotNull
@Override
public CoroutineContext getContext() {
return EmptyCoroutineContext.INSTANCE;
}
@Override
public void resumeWith(@NotNull Object o) {
String json = "";
try {
if (o instanceof Result.Failure) {
Result.Failure failure = (Result.Failure) o;
throw failure.exception;
} else {
runOnUiThread(new Runnable() {
public void run() {
Toast toast = Toast.makeText(NetworkQuizActivity.this.getApplicationContext(), getResources().getString(R.string.successQuizDownload), LENGTH_LONG);
toast.show();
}
});
}
} catch (Throwable th) {
Log.e("ERROR", th.toString());
}
}
}); ```
It returns my custom Toast, but file don't downloaded. Why?
What makes you say the file didn't get downloaded? Also, looking at your code, it doesn't look like you're doing anything with the downloaded file (the Object o)
What is Object o in this case?
This is io.appwrite.models.File?
No, it should be the bytes
And then i would be create file with these bytes?
Sure
I'll try it and feedback later
Thanks! It working!
[SOLVED] storage.getFileDownload() don't works correctly
Recommended threads
- Images/Videos in storage appearing broke...
I am running into a storage issue after upgrading my self-hosted Appwrite instance , all of my previously uploaded images and videos are now showing as broken i...
- `project_id_missing` in Cloud Function w...
I've got a cloud function written in `Dart-3.12` that I'm trying to create a file in a file bucket. I'm using the latest `dart_appwrite` sdk (`26.1.0`) and App...
- Batch Size of Bulk Operations
Is there any way to increase the Batch Size of Bulk Operations on Appwrite Self Hosted? When I try to perform more than 100 operations per batch, I get the foll...