uploading files to a webdav SSL enabled server

Paul Boddie paul at boddie.org.uk
Thu May 26 04:38:48 EDT 2005


rbt <rbt at athop1.ath.vt.edu> wrote in message news:<d720om$3cr$1 at solaris.cc.vt.edu>...
> Has anyone used pure python to upload files to a webdav server over SSL? 
>   I have no control over the server. I can access it with all of the 
> various webdav GUIs such as Konqueror, Cadaver, etc. by using a URL like 
> this:
> 
> webdavs://dav.hostname.com/user_name/uploads

I suppose it would be nice if urllib(2) supported WebDAV in this way,
but you should still be able to use httplib to interact with the
server. Uploading in WebDAV is just a matter of doing an HTTP PUT if I
recall correctly, and I don't think that any of the special status
codes or responses are involved; in this sense WebDAV overlaps with
traditional HTTP.

[...]

> If urllib2 supported webdav, I think I'd be in business, but it doesn't. 
> Any one who can provide pointers on this? I've googled around to no 
> avail. I've began playing with Perl's HTTP::DAV and somone reccomended 
> PHP's curl functions as well, but I wanted to try this in Python first.

Searching for "DAV Python" revealed the following projects:

http://www.lyra.org/greg/python/
http://cvs.infrae.com/packages/pydavclient/dav/

Really it's just a matter of talking HTTP to a server and parsing the
special messages that are returned for certain request methods, but
you may not even need to do that if you're just uploading files.

Paul



More information about the Python-list mailing list