?
Solved

Download files from WebDav with Python

Posted on 2004-08-10
4
Medium Priority
?
277 Views
Last Modified: 2010-04-16
Hello all,
I am trying to download files from a WebDav server that is using https.
Does anyone how I can accomplish this using Python or some other
script.  I want to download a file, rename on the server, then move it to a directory and
rename it there also.
Thanks,
Jason
0
Comment
Question by:kochsqlserv
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 9

Accepted Solution

by:
rjkimble earned 300 total points
ID: 11769289
This page looks promising:

http://www.lyra.org/greg/python/

I assume you plan to program this yourself.
0
 
LVL 7

Assisted Solution

by:BarryTice
BarryTice earned 300 total points
ID: 12070111
import urllib
sourceURL1 = 'http://www.experts-exchange.com/Programming/Programming_Languages/Python/Q_21088729.html'
targetFilePath1 = 'new_file_path_and_name.html'
nf = urllib.urlretrieve(sourceURL1, targetFilePath1)
sourceURL2 = 'http://www.experts-exchange.com/images/pe/166149.jpg'
targetFilePath2 = 'mugshot_of_ramrom.jpg'
nf = urllib.urlretrieve(sourceURL2, targetFilePath2)

This won't rename the file on the server, but it will allow you to get a file from an http server and save it to whatever path as whatever filename you like. A brief test with https://www.paypal.com/cgi-bin/webscr?cmd=_login-run suggests it runs with https as well.

Hope this helps...

-- b.r.t.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Plenty of writing has gone on the web trying to compare Python with other competitive programming languages and vice versa. However, not much has been put into a wholistic perspective. This article should help you decide whether to adopt Python as a…
Less strange, but still introduction This introduction was added (1st August, 2011) to reflect some reactions.  Firstly, the term basics in the title of the article...  As any other word, it is a symbol with meaning attached to the word by some a…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question