Download via FTP with JavaScript

2

I would like to know how I can be putting on my page the user's option to download via FTP. I do not want the user to enter the information for FTP access and also that he does not see the FTP data he is accessing to download.

Is this possible? If so, how can I proceed?

    
asked by anonymous 30.06.2015 / 21:23

1 answer

1

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.

    
01.07.2015 / 20:49