Solved

Download files from WebDav with Python

Posted on 2004-08-10
4
264 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 75 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 75 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Here I am using Python IDLE(GUI) to write a simple program and save it, so that we can just execute it in future. Because when we write any program and exit from Python then program that we have written will be lost. So for not losing our program we…
Strings in Python are the set of characters that, once defined, cannot be changed by any other method like replace. Even if we use the replace method it still does not modify the original string that we use, but just copies the string and then modif…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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…

688 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