Solved

Download files from WebDav with Python

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now