Christian,
I was trying to upload via Java code using the httpclient library. I am using the code below.
public void insertFile(File content) throws Exception { final HttpClientContext context = buildUserContext("http://localhost:8080/BaseX91/webdav/testDb/test", "admin", "admin"); PutMethod httpMethod = new PutMethod("http://localhost:8080/BaseX91/webdav/testDb/test"); InputStream is = new FileInputStream(content);
org.apache.commons.httpclient.HttpClient client = new org.apache.commons.httpclient.HttpClient();
client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("admin", "admin")); RequestEntity requestEntity = new InputStreamRequestEntity(is); httpMethod.setRequestEntity(requestEntity); try { int statusCode = client.executeMethod(httpMethod); if (statusCode != HttpStatus.SC_OK) System.err.println("Method failed: " + httpMethod.getStatusLine()); byte[] responseBody = httpMethod.getResponseBody(); System.out.println(new String(responseBody)); } catch (HttpException e) { System.err.println("Fatal protocol violation: " + e.getMessage()); e.printStackTrace(); } catch (IOException e) { System.err.println("Fatal transport error: " + e.getMessage()); e.printStackTrace(); } finally { httpMethod.releaseConnection(); }
}
-----Original Message----- From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: Monday, December 03, 2018 11:49 PM To: Kanda (US), David david.kanda@boeing.com Cc: BaseX basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] BaseX WebDAV Rejecting Large Files
Dear David,
I’ve just added a 200 MB file to a database via WebDAV without problems. Which WebDAV client are you using?
Best, Christian
On Mon, Dec 3, 2018 at 8:24 PM Kanda (US), David david.kanda@boeing.com wrote:
Hello,
We are attempting to use WebDAV to pump a large zip file to BaseX then have BaseX unzip and import the uncompressed xml file. WebDAV transfer works well with small files, (less than 1Mb) but it fails immediately when uploading a large zip or xml file (~50MB). Is there any sample code to demonstrate programmatically transferring a large file to BaseX over WebDAV?
Cheers,
David