FTP file transfers

J Juan-Antonio Martinez 3 years 5 months ago
14 1 0

Do FTP file transfers work? I am using this code and FTP server is not even "contacted". Am I doing something wrong? Thanks!
function FTPResult(res) {  alert(res); }

function FTPtransfer(direction, fileloc, filerem, server, user, passwd)    {    var txtSource;    var txtDest;      if ( direction == "UP" )    {    txtSource = "file://"+fileloc;    txtDest = "ftp://"+user+":"+passwd+"@"+server+"/"+filerem;    }   else    {    txtSource = "ftp://"+user+":"+passwd+"@"+server+"/"+filerem;    txtDest = "file://"+fileloc;    }              fileTransfer.transferEvent = "FTPResult(%s)";   fileTransfer.createFolders = true;   fileTransfer.overWrite = true;   fileTransfer.username = user;   fileTransfer.password = passwd;   fileTransfer.source = url(txtSource);         fileTransfer.destination = url(txtDest);         fileTransfer.transfer();       }

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

Hi, Your code looks like it's got a few syntax errors: * url is not a javascript function, you need to enclose whatever you give to source and destination parameters in quotes I would suggest ensuring you have logging turned on and seeing what error message are displayed in the log file. On an unrelated note there's a new developer forum, http://motorola-dev.hosted.jivesoftware.com/welcome where you may wish to post future queries there as this forum is being transitioned. 

CONTACT
Can’t find what you’re looking for?