Hello Clive,

 I believe that you can't get the content length from WebDavResource: not
until you download it. In your case, you should do a PROPFIND to the
resource URL, and from the response extract the DAV:contentlength property.

Best regards,
Miguel Figueiredo

-----Original Message-----
From: Clive Borrageiro [mailto:[EMAIL PROTECTED] 
Sent: terça-feira, 1 de Fevereiro de 2005 8:06
To: Slide Users Mailing List
Subject: How to get file size for download

Hi,

I need to get the size of a file on the server for download so that I can do
progress.
I tried 
        long fileSize = webDavResource.getContentLength();

But this returns '0'. I also tried setting the full path and relative paths
        
webDavResource.setPath("http://localhost:8080/slide/files/Test.txt";);
        or webDavResource.setPath("/files/Test.txt");

And I get 'URIException: invalid port number' - but it is the correct port
and
'HttpException' respectively.
How can I get the file size before downloading it.

Any help will be much appreciated!
Thanks.
Clive


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to