You can even do this, but in the most current browsers you get a confirmation screen that could be a possible fraud.
Here'sthesnippet:
varusername='user';varpassword='pass';varserver='toSomeServer';window.open("ftp://" + username + ":" +
password + "@" + server, '_blank',
'toolbar=no,location=no,status=no,' +
'scrollbars=auto,copyhistory=no,menubar=no,width='
+ ((screen.AvailWidth/2)-12) + ',height='
+ (screen.AvailHeight-124) +',left=' + ((screen.AvailWidth/2))
+ '),top=0,resizable=yes');
I do not think this is the most elegant solution to this.
A good alternative would be you dealing with it on the serverside.
On the Wc3 site has an example of connecting to PHP.
I hope I have helped.