Jump to content

ftp down?


zonedabone

Recommended Posts

It's a custon jython script. I made a little part of my ftp server with a username and password for everyone. Don't ask why. Anyway, here's the jython script, with the credentials omited:

 

connected = false
from ftplib import FTP
def connect(host,username,password):
global ftp
global connected
if connected == false:
	ftp = FTP(host,username,password)
	connected = true

def upload(filename,name):
global ftp
global connected
if connected == true:
	test = open(filename, 'r')
	ftp.storbinary('STOR ' + name, test)
	test.close()

def download(filename,path):
global ftp
global connected
if connected == true:
	dir = open(path, 'w')
	file = ftp.retrbinary('RETR ' + filename, dir.write)
	dir.close()

def close():
global ftp
global connected
if connected == true:
	ftp.quit()
		connected = false

def getwelcome():
global ftp
global connected
if connected == true:
	world.output = ftp.getwelcome()

def rename(oldfile,newfile):
global ftp
global connected
if connected == true:
	ftp.rename(oldfile,newfile)

def delete(file):
global ftp
global connected
if connected == true:
	ftp.delete(file)

def setdir(dir):
global ftp
global connected
if connected == true:
	ftp.cwd(dir)

def makedir(dir):
global ftp
global connected
if connected == true:
	mkd(dir)

def deldir(dir):
global ftp
global connected
if connected == true:
	ftp.rmd(dir)

 

Right now, it just seeems to be running really slow. I need high speed. I'm only transmitting files of 5kb down, and they need to go FAST.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...