Welcome
Login
Sign up
Home
Solutions
Forums
How can we help you today?
Enter your search term here...
Search
Login
or
Signup
to submit a new ticket
Check ticket status
Start a new topic
Discussions
Kinvey Forums
Android
How download file by Name?
В
Веталь Маркус
started a topic
almost 6 years ago
I download image from kinvey server, using this code by ID:
this.file = new File(folder, idImage);
this.fileMetaData = new FileMetaData(idImage);
this.fileOutputStream = new FileOutputStream(file);
client.file().download(fileMetaData, fileOutputStream, new DownloaderProgressListener()
{
@Override
public void onSuccess(Void arg0)
{ //Set File to ImageView }
@Override
public void onFailure(Throwable t)
{ //FAIL }
@Override
public void progressChanged(MediaHttpDownloader arg0) throws IOException { }
});
How download images from Kinvey Server by File_Name?
1 Comment
E
Edward
said
almost 6 years ago
Does every file have a unique file name? By default the library the uses _id for lookups because each one is guaranteed to be unique.
Check out the javadocs for the File API, there is a download method that takes a query-- can you try this?
http://devcenter.kinvey.com/android/reference/api/reference/com/kinvey/android/AsyncFile.html#download(com.kinvey.java.Query, java.io.OutputStream, com.kinvey.java.core.DownloaderProgressListener)
If you use the query to match a filename it should do it for ya-- although you might need a very specific query because this method will only download the first result returned.
Login
or
Signup
to post a comment
More topics in
Android
Can I add KinveyReferences and other custom Arrays to the User entity?
How can I use custom enums within my Entity?
Linking an image does not save with LinkedData
How can I get all records saved by the current user?
Why don't all users see the same data when querying?
Retrieving related file from datastore collection - continued
Problem implementing sign up / login
Can Android API be used for Java?
I'm not receiving push notifications
It is impossible to receive object according to the link
See all 258 topics
Веталь Маркус
this.file = new File(folder, idImage);
this.fileMetaData = new FileMetaData(idImage);
this.fileOutputStream = new FileOutputStream(file);
client.file().download(fileMetaData, fileOutputStream, new DownloaderProgressListener()
{
@Override
public void onSuccess(Void arg0)
{ //Set File to ImageView }
@Override
public void onFailure(Throwable t)
{ //FAIL }
@Override
public void progressChanged(MediaHttpDownloader arg0) throws IOException { }
});
How download images from Kinvey Server by File_Name?