Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Download files from WebDav with Python

Posted on 2004-08-10
4
Medium Priority
?
293 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
2 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The really strange introduction Once upon a time there were individuals who intentionally put the grass seeds to the soil with anticipation of solving their nutrition problems. Or they maybe only played with seeds and noticed what happened... Som…
This article will show the steps for installing Python on Ubuntu Operating System. I have created a virtual machine with Ubuntu Operating system 8.10 and this installing process also works with upgraded version of Ubuntu OS. For installing Py…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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…
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 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