Thanks,
Pranav
Kinvey Support
try{
File file = new File(""+Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)+"/aa.jpg");
/* File[] files = file.listFiles();
if(files != null){
for(File f : files){ // loop and print all file
System.out.println(f.getName()+"------------------");
// this is file name
}
}*/
// File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/aa.jpg");
//java.io.File file = new java.io.File("aa.jpg");
FileInputStream fin=new FileInputStream(file);
UploaderProgressListener upl=new UploaderProgressListener() {
@Override
public void onSuccess(Void result) {
System.out.println("upload success!");
}
@Override
public void onFailure(Throwable error) {
System.out.println("upload progress change!");
}
@Override
public void progressChanged(MediaHttpUploader uploader) throws IOException {
System.out.println("upload progress change -> " + uploader.getUploadState());
}
};
mKinveyClient.file().upload("myFile1",fin,upl);
}catch(Exception e){
System.out.println("Couldn't upload! -> " + e);
e.printStackTrace();
}
System.out.println("after uploading file");
hey I am using above code to upload an image from my android app. it is uploaded on kinvey server but when I try to open it by using download link it shows "This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Message>The specified key does not exist.</Message>
</Error>
"
but if I directly drop a file on page of kinvey server it seems fine and opened by download link. .png?1477679912)
in this screenshot , first two images are uploaded by app and third one is dragged and dropped on this page. I don't know what is the problem here ! can you please sort it out ?
thanks in advance
Ankush Chaudhary
my code for taking a picture and storing in storage given below ,
but i don't know how to upload image , i tried the upload section code provided at store , but does'nt work well, could any one help me please....
here is my code........