Hi,
this from the Slid forum, one of our freinds had the same problem and has a fix. I am yet to try the fix. hope this will be taken care in the next release or build or Tamino WebDAV server as well.
Regards
Pushparajan
----
I have same trouble. I am using some original Webdav server.
The Webdav server does not accept PUT Header without Content-Length:
So I have modified WebdavResource, PutMethod.
I hope to be supported by Slide.
PUT(file) : easy to implement
Content-Length: file.length()
PUT(InputStream) : I add setContentLength(length)
to be called before calling PUT(InputStream)
1 WebdavResource
1) coment out import statement of httpclient.method
Because I would like to modify org.apache.webdav.lib.method.PutMethod
rather than org.apache.commons.httpclient.methods.PutMethod
/*
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.HeadMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
/
2) Add setContentLength(long length) method for Put(InputStream)
private long contentLength = -1 ;
/**
* Set Content-Length for Not File.
* @param length of InputStream PUT data
*
/
public void setContentLength(long contentLength) {
this.contentLength = contentLength;
}
3) Chnage calling sequence method.sendData(
except method.sendData(file);
/ modified PUT
From method.sendData( is,byte[] data,string data,url
→ method.setContentLength(contentLength);method.sendData(
/
/* ex. original
method.sendData(is);
to */
method.setContentLength(contentLength);
method.sendData(is);
2. org.apache.webdav.lib.PutMethod
private long contentLength = -1;
/**
* Set Content-Length for Not File.
* @param length of InputStream PUT data
*
*/
public void setContentLength(long contentLength) {
this.contentLength = contentLength;
}
2.1 sendData(file)
public void sendData(File file)
throws IOException {
setHeader(“Content-Length”, String.valueOf(file.length()) ) ;
super.sendData(file);
}
2.2 sendData(!file)
sendData(String data) sendData(InputStream is)
sendData(byte data) sendData(URL url)
public void sendData(InputStream is)
throws IOException {
if (contentLength >= 0){
setHeader(“Content-Length”, String.valueOf(
contentLength ) );
contentLength = -2;
}
super.sendData(is);
}
At 13:51 01/10/30, Remy Maucherat wrote:
>
>> > Hi,
>> >
>> > I’ve downloaded the Slide source and Binanries. I compiled the Slide
>> > Client (Slide.java). When I do an PUT command it always creates a new
>file
>> > in the webdav directory with zero byte length. All other commands like
>> > dir, get etc work properly. Pls help me fix this.
>
>What is the server you’re using ? Because of a variety of problems with the
>HTTP client, chunking is used when uploading with a PUT if the server is
>HTTP/1.1, which is something some servers don’t like.
>Tomcat 4.0 should work ok. Tomcat 3.x should also be ok (it will be
>identified as a HTTP/1.0 server) in standalone.
>
>Remy
–
Yoshiyuki Kumadaki/?? ??
Web Japan Co.,Ltd /???
http://www.webjp.co.jp/
–
To unsubscribe, e-mail: mailto:slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: mailto:slide-user-help@jakarta.apache.org
#Tamino#webMethods#API-Management