| Article: |
Sliding into WebDAV | |
| Subject: | WebDAV & NTLM:Hi i am facing a problem to connect to MSSharePoint 2003 portal server | |
| Date: | 2007-02-12 09:20:56 | |
| From: | PabloMosquera | |
|
Response to: WebDAV & NTLM:Hi i am facing a problem to connect to MSSharePoint 2003 portal server
|
||
|
Hi, Im having the same problem with the same httpException. I´m trying to connect to a IIS server and I use the same code. Please tell me how you solved the problem
|
||
Showing messages 1 through 1 of 1.





Hi, Im having the same problem with the same httpException. I´m trying to connect to a IIS server and I use the below code. Please tell me how you solved the problem
public static boolean fileUpload(String localfilepath,String url,String destfolder,String destfile)
{
boolean success=false;
try
{
File file = new File(localfilepath);
BufferedImage image = ImageIO.read(file);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(image, "bmp", bos);
byte byteArr[] = bos.toByteArray();
bos.close();
HttpURL hrl =new HttpURL(url);
//hrl.setUserinfo("uname","password");
WebdavResource wdr =new WebdavResource(hrl);
success = wdr.putMethod("/"+destfolder+"/"+destfile, byteArr);
wdr.close();
System.out.println(success);
}catch(Exception ex)
{
ex.printStackTrace();
}
return success;
}
My IIS server is running in windows server 2003 platform.and i will get the exception below.
org.apache.commons.httpclient.HttpException
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3467)
at org.apache.webdav.lib.WebdavResource.propfindMethod(WebdavResource.java:3423)
at org.apache.webdav.lib.WebdavResource.setNamedProp(WebdavResource.java:967)
at org.apache.webdav.lib.WebdavResource.setBasicProperties(WebdavResource.java:912)
at org.apache.webdav.lib.WebdavResource.setProperties(WebdavResource.java:1894)
at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1301)
at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1320)
at org.apache.webdav.lib.WebdavResource.setHttpURL(WebdavResource.java:1408)
at org.apache.webdav.lib.WebdavResource.<init>(WebdavResource.java:290)
------------------------------------------------
But the same above code work successfully by connecting the IIS server which is running in WindowsXP platform. Please Suggest the solution and help me. Thanks a lot.
By Saravanan.K