By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,852 Members | 2,200 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,852 IT Pros & Developers. It's quick & easy.

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

P: 5
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

Expand|Select|Wrap|Line Numbers
  1. Net::SFTP::Foreign 
  2.  
or

Expand|Select|Wrap|Line Numbers
  1. system (scp username@ipaddress...);
  2.  
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
Jan 21 '10 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 785
You can use perl-function gethostbyname(DOMAINNAME)
It returns the packed IP-address, so you can unpack it with the unpack('C4') function.
Feb 8 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.