Hi,
I am trying to write a WebDAV client using the http and Webdav librarys that come with Slide. I have the following code. This does create a file in the Webdav directory but the file size is Zero.
String dest = getPath();
String src = “c:/filetoupload.txt”;
File file = new File(src);
System.out.println(file.length());
if (file.exists()) {
System.out.print(“Uploading '” + src +
“’ to '” + dest + “': “);
if (webdavResource.putMethod(dest+”/filea.txt”, file)) {
System.out.println(“succeeded.”);
} else {
System.err.println(“failed.”);
System.err.println(
webdavResource.getStatusMessage());
}
} else
System.err.println
(“Warning: File not exists”);
Regards
Pushparajan