C
C
cruzo2015-10-06 17:58:59
Android
cruzo, 2015-10-06 17:58:59

Is there a working example of Yandex.Disk WebDAV implementation on Android, for files larger than 1 mb?

There is such a function implemented using JackRabbit:

client = new HttpClient();
credentials = new UsernamePasswordCredentials(username, password);
client.getState().setCredentials(AuthScope.ANY, credentials);

method = new PutMethod("https://webdav.yandex.ru/myfolder/myfile.jpg");
File f = new File(fileToUpload);

RequestEntity requestEntity = new FileRequestEntity (
                f , "image/jpeg");
        
((PutMethod) method).setRequestEntity(requestEntity);
        
if (f.length() > 100000) {
  	((PutMethod) method).setContentChunked(true);
}

client.executeMethod(method);

Only here is the problem, sending files over 1 MB does not work. What am I doing wrong?
Maybe someone has a working example for files larger than 1MB.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cruzo, 2015-10-07
@cruzo

If suddenly someone came here, use the WebDAV SDK from Yandex, and you will be happy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question