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
- All My Project is Gone
Hello everyone, please help. Why have all my projects suddenly disappeared? I received a warning via email about one of my projects being paused. When I clicked...
- {"code": 1008, "message": "Invalid Origi...
Nothing has changed in my application or console settings so I'm curious as to what I need to do to fix this. I already have the client registered so I'm not en...
- android platform invaild origina
It happened today suddenly. Our app says invalid origin. And appwrite cloud says every time we tried to add the app to it: "param platformId" is not optional.