wolverina has asked for the wisdom of the Perl Monks concerning the following question:

I'm still trying to figure out how to do a seemingly
trivial thing using net::ftp. I have this script
generator called web-libs.. some may have heard of it.
All i want to do is when the script is generated,
have it uploaded as a file to my ISP. I'm assuming
that the userID and password in a net::ftp script
is the same userID and password i would use if using
a regular ftp program. I emailed verio.. here's my
question and they're response.
--------

ME:
I'm trying write a perl script where,
when a user clicks submit, the results
from a form are uploaded to my web site.
Is this possible using verio's perl modules?
Someone informed me about perl modules
called net::ftp, and ftp.pm. If someone
in tech support could give some info
on this, it would be appreciated.
Thanx. :) Lisa.
-----------

VERIO:
What you are trying to accomplish can be done. However,
if your script is dependent on the net::ftp module
and there is no way to upload that module to your site
and reference it inside your script then your code will
not work. We will not install modules on the
server. By going to the following url you can see the list of
modules we have installed.
http://home.verio.net/support/view_article.cfm?doc_id=640
----------

First of all, i was under the assumption that net::ftp
is part of ftp.pm, which is included in their installed
module list. If that's true, i'm not sure why tech support
would tell me to upload the module to my site. If ftp.pm
includes the net::ftp command, can i assume it will work?
Thanx, Lisa.

Replies are listed 'Best First'.
Re: net:ftp
by Beatnik (Parson) on Dec 13, 2001 at 17:48 UTC
    Your question is rather cryptic. You mention files being generated and you want them uploaded. How? Thru a form (like you stated in the question block) or thru FTP like you mention some people point to.
    • Option 1: Form (select file and press upload)
      This requires you to have a script on your server that uses CGI.pm. This module should be installed by your ISP. I suggest making sure not everyone has access to the page where to form is on, making sure your webspace doesn't get flooded with crap. This option requires nothing from you, client side, except for a recent browser. There are several good nodes on file uploading thru CGI.pm, like Uploading a file but a Super Search on Upload will probably return plenty more.
    • Option 2: FTP based either thru a plain FTP client or a script on client side that uses Net::FTP). This is more secure than the form, since normally you only have access to your FTP space.
      Option 2a : (FTP Client based). This requires you to have an FTP client (See here for a list of Windows FTP Clients). Server side, this requires that the ISP has an FTP server running (which is pretty common). If you're planning this, check with your ISP.
      Option 2b: (Net::FTP based). Technically, Net::FTP scripts are also FTP clients. This also requires the FTP server on your ISP's server. Client side (as in on your computer), you need Perl installed ActiveState Perl and Net::FTP (probably installed using PPM]. Again use Super Search to look for Net::FTP. Example thread is Using Net::Ftp


    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
Re: net:ftp
by lestrrat (Deacon) on Dec 13, 2001 at 07:08 UTC

    I don't see either FTP.pm ( whatever that is ) nor Net::FTP in that list. What's mildly interesting here is that I thought Net::FTP was a prerequisite to installing libwww, but they seem to have that installed ... weird

    In any case, I think you're asking the wrong question:

    I'm trying write a perl script where, when a user clicks submit, the results from a form are uploaded to my web site.

    That's fine, but I think you're talking about HTML forms, in which case it doesn't use FTP. it uses HTTP + CGI.

    Just as luck would have it, it looks like they don't have CGI.pm installed at your ISP, but you can always install it on your home directory. Perhaps a better approach to this is to change your ISP to some where that has better perl support...

      Doesn't this mean it's installed?
      ./site_perl/URI/URL/http.pm
      ./site_perl/URI/URL/ftp.pm <--------?
      ./site_perl/URI/URL/_generic.pm?
        No, that module would be URL::URI::ftp
        the one you want should look like this:
        ./site_perl/net/ftp.pm
      No.. mad-libs saves the generated script as
      a file. As soon as the file is saved on my
      harddisk,i want to to upload to my ISP site.

      Lisa.

        Hmm, I'm not aware of this mad-lib stuff, but I just have this sneaking suspscioun that something is not right...

        I'm assuming this situation: for whatever reasons, you have a need to upload via ftp a file to (presumably) your account in your ISP.

        If that were the case, then there's no point in asking for the module list of your ISP... You would instead need Net::FTP in your local host, not in your ISP, no?