473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Download several files at once using FTP

1 New Member
I am new to python and I am using the FTP module to retrieve files via FTP. This is a sample of my code:

buffer = StringIO.String IO()
ftp.retrbinary( 'RETR CAT3.TXT', buffer.write)
ftp.retrbinary( 'RETR CAT4.TXT', buffer.write)

When I view the buffer the only information I see is the last file info which is CAT4.TXT. Is there a way I can create a list of these files?

Thanks.
Jul 20 '07 #1
2 2581
bartonc
6,596 Recognized Expert Expert
Found this in the Articles section.
Jul 20 '07 #2
bartonc
6,596 Recognized Expert Expert
I am new to python and I am using the FTP module to retrieve files via FTP. This is a sample of my code:

buffer = StringIO.String IO()
ftp.retrbinary( 'RETR CAT3.TXT', buffer.write)
ftp.retrbinary( 'RETR CAT4.TXT', buffer.write)

When I view the buffer the only information I see is the last file info which is CAT4.TXT. Is there a way I can create a list of these files?

Thanks.
Expand|Select|Wrap|Line Numbers
  1. >>> import StringIO
  2. >>> for i in range(3):
  3. ...     exec("buffer%d = StringIO.StringIO()" %i)
  4. ...     
  5. >>> buffer0
  6. <StringIO.StringIO instance at 0x02FDC8A0>
  7. >>> buffer1
  8. <StringIO.StringIO instance at 0x02FDCEB8>
  9. >>> buffer2
  10. <StringIO.StringIO instance at 0x03038B98>
  11. >>>
Jul 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1543
by: Paul | last post by:
I need a way of creating a custom file which can be downloaded by a user. The file needs to be customized pre user (ie serial number built in). Creating the file is no problem. The problem is how can several files be created at the same time (ie several users logged in to the web site at once wanting to download their file). A temporaty file...
1
3193
by: RJN | last post by:
Hi Sorry for posting this again. Requirement is to allow the user to download multiple files at once from browser. User will be displayed a grid on the browser which will list the various files available on the web server for download and a check box beside each for selecting the file. I have received replies that this can be done by an...
1
2705
by: rdemyan via AccessMonster.com | last post by:
My App has 10 or so tables that we provide that contains proprietary data. This data will need to be updated once or twice a year. I would like some comments, suggestions on my proposed strategy for updating these tables via an ftp site: 1) Post a .mdb file to our ftp web site that contains the updated tables. My App code connects to the...
2
6937
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
1
47389
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2114
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 we have to send another system
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.