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
- OAuth Missing redirect URL
Hello all, on a Flutter mobile app with latest Appwrite dependency (25.4.0) I always got "Missing redirect URL" - "Your OAuth login flow is missing a proper red...
- Need Help on Self Hosted Version of Appw...
Hi i wanted to test SMS OTP verify method but i am not able to do it. I follow all the steps but no luck. Please help me with this. I am using Appwrite self hos...
- 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...