473,474 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

getting files over ftp

Joe
How can you grab files over an ftp connection using ftplib? I can
make the connection, browse to the directory, view directory, but
can't copy over the files.

Thanks
Jul 18 '05 #1
2 1673
On 2004-01-28 13:49:15 -0500, he*******@hotmail.com (Joe) said:
How can you grab files over an ftp connection using ftplib? I can
make the connection, browse to the directory, view directory, but
can't copy over the files.

Thanks


How about the retrbinary() function?
Jul 18 '05 #2
he*******@hotmail.com (Joe) wrote in message news:<56**************************@posting.google. com>...
How can you grab files over an ftp connection using ftplib? I can
make the connection, browse to the directory, view directory, but
can't copy over the files.

Thanks


def ftp_download(host, user, pswd, ftpdir, filename):
"""Downloads a single file from an FTP server"""
ftp = ftplib.FTP()
ftp.connect( host )
ftp.login ( user , pswd )
ftp.cwd ( ftpdir )

f = file( filename , "wb" )
ftp.retrbinary("RETR " + filename, f)
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
6
by: bill | last post by:
I have been presented with the task of getting the last file from a linux directory when the files are of the form: nnnnnn-xxxxxxx-.ext where nnnnnn are 6 numeric digits and xxxxxx is variable...
1
by: sonasiva | last post by:
hai I am new bie for ASP I retrieved files name from a folder by using FSO problem is if i click that name link files are getting open <%
13
by: lawpoop | last post by:
Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are...
4
by: imaloner | last post by:
I am posting two threads because I have two different problems, but both have the same background information. Common Background Information: I am trying to rebuild code for a working,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.