Uploading a file and copying over the file onto a remote server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • darkenroyce
    New Member
    • Mar 2008
    • 5

    Uploading a file and copying over the file onto a remote server

    Hi All,

    I am currently trying to code HTML and perl to upload a file (using input type="file") from a local PC and onto a remote UNIX server. The web application is located on the remote UNIX server.

    I understand that I would have to SFTP the file to the remote UNIX server and that I could either script Perl using

    Code:
    Net::SFTP::Foreign
    or

    Code:
    system (scp username@ipaddress...);
    Unfortunately, I'm programming the scripts to avoid using many Perl libraries.

    My question if I want to scp the file on the remote unix server, how I code the script to pick up the ip address of the client PC so that I can scp the file to remote unix server?

    Thanks,

    Darken
  • chaarmann
    Recognized Expert Contributor
    • Nov 2007
    • 785

    #2
    You can use perl-function gethostbyname(D OMAINNAME)
    It returns the packed IP-address, so you can unpack it with the unpack('C4') function.

    Comment

    Working...