Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP client with web frontend?

Status
Not open for further replies.

Nebbish

Programmer
Apr 7, 2004
73
US
Hey all,

I'm looking for some sort of Perl package or distribution that provides FTP functionality via a web interface. I figured this sort of thing would be all-pervasive, but I'm having a bit of trouble finding exactly what I'm looking for. Maybe I'm just not looking for the right thing.

I could write up such a script myself, but, this is a wheel that should have already been invented many times over.

Advice appreciated,

Nick
 
Your web browser almost certainly supports ftp directly. All you need to do is supply an ftp url (e.g. "ftp://ftp.funet.fi").


Trojan.
 
Heh, it does indeed. Though, I'm looking for something slightly more functional. Specifically, this "web front-end" needs to be able to upload, download, create directories, rename directories, and remove directories. Some sort of login page would be nice, too- the "ftp://mylogin:mypwd@ftpserver.com" isn't quite friendly enough (this particular ftp site drops you in a public ftp area by default if you leave out the myogin:mypwd@ portion). Most browsers allow a drag-and-drop for uploading, but I'm looking for one of those webmail-attach-filesish, browse-your-filesystem inputs.

Basically, this is for a client who wants things nice, simple, and intuitive. Even a straightforward ftp client is too complicated for them.
 
Maybe something with CGI.pm and Net::FTP.pm that lets you pick the remote ftp site to login to and which commands you implement from the selection of methods that Net::FTP gives you?

Of course, to use a web interface, you need a web server to run this ftp app on. Then if you're uploading files you'd have to ftp them to the web server to be able to use the web ftp app to upload them via ftp somewhere. If you're downloading files, they'd end up on the web server.

Here's a skeleton program using CGI and Net::FTP which could be used as a rough start toward that type of program:

Code:
#!/usr/bin/perl
use strict;
use Net::FTP;
  
 use CGI qw/:standard/;
 print header,
 start_html('An FTP server example '),
 h1('An FTP Server'),
 start_form,
 "FTP Server: ",textfield('remote_server'),p,
 "Options: ", p,
 checkbox(-name=>'Passive', -checked=>0,-value=>1, -label =>'Passive' ), p,
 checkbox(-name=>'Debug',-checked=>0,-value=>1, -label =>'Debug'),p,
 "Username: ",textfield('username'),p,
 "Password: ",password_field('password','',0,8),p,
 checkbox(-name=>'do_command_ls',-checked=>0,-value=>1,-label=>'ls'),p,
 textfield('ls_where'),p,
 submit,
 end_form,
 hr;
 my ($ftp);
 if (param('remote_server'))
   {
   print "Connecting to ",param('remote_server')," (really ftp.kernel.org)",br;
   $ftp=Net::FTP->new("ftp.kernel.org",Debug=>0,Passive=>1) or
        die "Cannot connect: $@ $!\n";
   $ftp->login()or die "login: ",$ftp->message,"\n";
   if (param('do_command_ls'))
     {
     print "Getting ls of ",param('ls_where'),br;
     my @return= $ftp->ls("pub/linux") or die "ls: ",$ftp->message," \n";
     foreach (@return)
       {print "$_<BR>\n" }
     }
   hr;
   }

Just an example of how you could implement something like this. If you use the same machine for web server as samba shares, you could then add a button or two to move files to that user's private share location or to a public share...

Kordaff - example at
PS working example lets you enter domain, directory to do ls on, but only connects to ftp.kernel.org.
 
Kordaff,

Thanks for the detailed response- you seem to have the basic idea of what I'm looking for. My original fantasy was that someone would post a link to some distribution (like Perlfect, for example), that has a decent template system, a good interface, and all the necessary functionality, and just needs a few tweaks to a configuration file to point to the right ftp server, etc. I'm capable of developing something like you've posted, but I just can't shake the feeling that this sort of thing has been done before.

It's not a big project, but two days of work coding up something like this is more time than I was hoping to spend.

-Nick
 
The spends are down to the client surely ...

Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Maybe something like ?

That's web based.

About:
CMS (Content Management System) is a Perl-based groupware
application that allows a group of people to share
documents via a Web interface. Documents can be checked-in,
checked-out, reserved, etc.

Kordaff
 
Kordaff,

What you found is close, but the primary "check-out" functionality is extraneous for us. It'd work, but it's not a slam-dunk. However, it did lead me to find two packages that seem to be a perfect fit for what we're looking for (pending actual implementation and experimentation).

Drall:
and

Web-FTP:
Both Perl implentations of a web-based FTP client.

-Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top