Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

A Simple FTP Solution

0.00/5 (No votes)
23 Oct 2008 2  
This is a tiny utility to send or to bring files among your computer and your provider. See it in action: http://www.industriavirtual.com.br/codedemo/easyftp/index.htm If you find it useful, please vote!

Sample Image - easyftp.jpg

The HTML file

<html><head>
<link rel='stylesheet' href='ftp.css'>
<script language="'javascript'" src='ftp.js'></script>
<title>Easy FTP 1.0</title></head>

<body bgcolor='#ffffff'>
    <br><font class='title'><b>Easy FTP 1.0</b></font><hr>
    After connecting, you can drag'n drop files among the windows. 
    Left window is your local folder, right window is the remote folder.
    <p><table border='0' cellpadding='0' cellspacing='1' 
              align='center' width='98%'><form name=login>
        <tr><td class='brgtcell' align='right'> Username </td>
        <td class='darkcell'> <input type='text' 
          name='username' value='anonymous' size='20' 
          maxlength='20'>  </td></tr>
        <tr><td class='brgtcell' align='right'> Password </td>
        <td class='darkcell'> <input type='text' 
          name='password' value='microsoft' size='20' 
          maxlength='20'>  </td></tr>
        <tr><td class='brgtcell' align='right'> Server </td>
        <td class='darkcell'> <input type='text' 
          name='server' value='ftp.microsoft.com' size='60' 
          maxlength='120'>  </td></tr>
        <tr><td class='brgtcell' align='right'> Local </td>
        <td class='darkcell'> <input 
          type='text' name='local' value='c:\' size='60' 
          maxlength='200'>  </td></tr>
    </table>
    <hr><table border='0' cellpadding='0' cellspacing='0' width='100%'><tr>
    <td align='right'><input style='color:#000000' 
      type='button' value='Connect' onClick='Login(this.form)'></td>
    </tr></form></table> 
</body></html>

The JS File

function Login(form) {
    var username = form.username.value;
    var password = form.password.value;
    var server = form.server.value;
    var local = form.local.value;
    if (username && password && server && local) {
            window.open(local, '_blank', 
              'toolbar=yes,location=yes,status=yes,' + 
              'scrollbars=auto,copyhistory=no,menubar=no,width=' 
              + ((screen.AvailWidth/2)-12) + ',height=' + 
              (screen.AvailHeight-124) +',left=0,top=0,resizable=yes');
            window.open("ftp://" + username + ":" + 
              password + "@" + server, '_blank', 
              'toolbar=yes,location=yes,status=yes,' + 
              'scrollbars=auto,copyhistory=no,menubar=no,width=' 
              + ((screen.AvailWidth/2)-12) + ',height=' 
              + (screen.AvailHeight-124) +',left=' + ((screen.AvailWidth/2)) 
              + '),top=0,resizable=yes');
            }
        else {
            alert("NO BLANK FIELDS!");
            }
    }

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here