FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 25th, 2001, 10:34 AM
xangelusx xangelusx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: MA, USA
Posts: 64 xangelusx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 41 sec
Reputation Power: 7
Angry FTP Problems

I'm having trouble with the ftplib module in Python 2.0

It was working yesterday but today it is giving me trouble. I'll post the traceback output below.

Code:
Traceback (most recent call last):
  File "c:\python20\pythonwin\pywin\framework\scriptutils.py", line 394, in ImportFile
    exec codeObj in __main__.__dict__
  File "<auto import>", line 1, in ?
  File "C:\Documents and Settings\All Users\Desktop\ftp_test.py", line 13, in ?
    ftp = ftplib.FTP("webstage.intra.lifespan.org")
AttributeError: FTP

Any thoughts?

Thanks,
Chris
__________________
"Once begun, half done." - EP

Reply With Quote
  #2  
Old July 25th, 2001, 01:20 PM
Theeggman Theeggman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 266 Theeggman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 33 sec
Reputation Power: 7
If you haven't changed your Python script from the night before I would say it is something outside of your Python script that has changed.

I can't be much more helpful than that without seeing the code.

Reply With Quote
  #3  
Old July 25th, 2001, 01:25 PM
xangelusx xangelusx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: MA, USA
Posts: 64 xangelusx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 41 sec
Reputation Power: 7
Code

Good point - Here's the code.
Code:
import ftplib
import os
import re

print "\nBegining Transfer..."

reportDirectory = "C:\Program Files\Analog\Reports"
ftpTarget = "webstage.intra.lifespan.org"
ftpDirectory = "webreports/testing"
ftpUser = "anonymous"
ftpPass = "anon@lifespan.org"

ftp = ftplib.FTP("webstage.intra.lifespan.org")
ftp.login(ftpUser,ftpPass)
ftp.cwd(ftpDirectory)
print "\n" + ftp.getresp()
#print os.getcwd()
for file in os.listdir(reportDirectory):
	print "\n" + file
	if re.match("\w+\d{6}\.html",file):
		ftp.storbinary("STOR" + file, open(file, "rb"), 1024)
		print "\n" + ftp.getresp()
		
print "\nDone Transfer"

print ftp.dir()

ftp.quit()

Last edited by xangelusx : July 25th, 2001 at 01:39 PM.

Reply With Quote
  #4  
Old July 30th, 2001, 05:35 PM
Theeggman Theeggman is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Posts: 266 Theeggman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 33 sec
Reputation Power: 7
Sorry its taken me so long to get back to you.

I ran your code up until the point that I logged in to a server. One problem I found is that the address could not be found which generated an error. I put in my own ftp address with l/p and it worked fine.

I only ran the code on the interactive command line until this point.

print "\n" + ftp.getresp()

Hope this helps.

E.

Reply With Quote
  #5  
Old July 31st, 2001, 07:41 AM
xangelusx xangelusx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: MA, USA
Posts: 64 xangelusx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 41 sec
Reputation Power: 7
Hi, and thanks for writing back again.

I can't believe I didn't catch this before but the problem was because I was trying to connect to our intranet server from our extranet server which exists on the outside of our firwall. DUH!

Thanks again for checking into it, though.

Chris Bloom

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > FTP Problems


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway