cannot put files with OwnCloud7

144 views
Skip to first unread message

Thierry CHARLES

unread,
Sep 3, 2014, 2:17:15 AM9/3/14
to sardi...@googlegroups.com
Hi,

Since I have upgraded my owncloud from OC5 to OC7, I cannot put files anymore, but I can list them

Does someone have an idea ?

Thank you !


        try {
            URL davUrl = new URL("http://cloud.provider.net/remote.php/webdav/zz");
            Sardine sardine = SardineFactory.begin(sMyLogin, sMyPassword);
            sardine.enablePreemptiveAuthentication(davUrl.getHost());
            boolean b = sardine.exists(davUrl.toString()); // returns true
            System.out.println("ex="+b);
            sardine.put(davUrl.toString() + "/test_" + System.currentTimeMillis() + ".jpg", new FileInputStream("/tmp/1920x1200.jpg"));
        }
        catch (Throwable e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

Error : (see attached file for full logs)
com.github.sardine.impl.SardineException: Unexpected response (400 Bad request)
    at com.github.sardine.impl.handler.ValidatingResponseHandler.validateResponse(ValidatingResponseHandler.java:49)
    at com.github.sardine.impl.handler.VoidResponseHandler.handleResponse(VoidResponseHandler.java:35)
    at com.github.sardine.impl.handler.VoidResponseHandler.handleResponse(VoidResponseHandler.java:30)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:218)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:160)
    at com.github.sardine.impl.SardineImpl.execute(SardineImpl.java:807)
    at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:739)
    at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:722)
    at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:710)
    at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:680)
    at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:673)
    at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:666)
    at com.github.sardine.impl.SardineImpl.put(SardineImpl.java:660)
    at Test.main(Test.java:22)

logs.txt

Thierry CHARLES

unread,
Sep 3, 2014, 10:08:41 AM9/3/14
to sardi...@googlegroups.com
Ok, the regression in OwnCloud is that they doesn't accept put request without content length :'(
Reply all
Reply to author
Forward
0 new messages