FTP File Truncated

HI,

I am facing the same problem if you guys can help me out.
File on machine is getting created but not showing any data.
Have Test.txt file on server and want to copy the content of it to new file on machine.

Following is the code.

def getTestFile():
import os
import system
from ftplib import FTP

ftp = FTP('server name')
ftp.login('ID,'password')     

filename = system.file.getTempFile("txt") 
s=ftp.retrbinary('RETR Test.txt', open(filename,'wb').write)
print s

system.file.writeFile("C:\\TempTest\\NewTest.txt", system.file.readFileAsBytes(filename))
ftp.close()

Thank you in advance.
Need to deliver this feature urgent.