
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
- The current user is not authorized to pe...
Hello, I am attempting to receive fetch data from databases.listDocuments with each of its env parameter data for it to be shown on a NextJS project. However I ...
- Correct way to play videos on storage in...
I’m kinda stuck on what is the correct and seamless way of playing videos stored Appwrite storage in a flutter app. I have long videos of 3-5 hours but of less ...
- FATAL EXCEPTION NullPointerException: nu...
Hi I'm using your SDK in my Android app... i upgraded to io.appwrite:sdk-for-android:8.1.0 and now i'm getting the following errors on Appwrite servers with ol...
