LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   file transfer (https://www.linuxquestions.org/questions/programming-9/file-transfer-538262/)

munna_dude 03-17-2007 08:11 AM

file transfer
 
hi all
how can i transfer a file from one system to other
is there any possible way.
i am using F5 AMD
please help me

thank you in advance

cfaj 03-17-2007 08:14 AM

Quote:

Originally Posted by munna_dude
hi all
how can i transfer a file from one system to other
is there any possible way.
i am using F5 AMD

Code:

scp FILE REMOTE:
Replace FILE with the path to the file you want to copy, and REMOTE with the system you want to copy it to.

munna_dude 03-17-2007 08:46 AM

thank you for quick replay
 
Quote:

Originally Posted by cfaj
[INDENT]
Code:

scp FILE REMOTE:
Replace FILE with the path to the file you want to copy, and REMOTE with the system you want to copy it to.

how can i use it in programatically.
and is there any file size problem to send.

i would like to send one.txt(of size 1mb) to other system through mailid

is it possible.
if yes how can i do it in programatically

thank you in advance

munna_dude 03-23-2007 06:29 AM

hi all

i tried like this to send a file from one system to others
Code:


scp file1.txt userid@remote_box:

and also this
[CODE]
scp -rp /root/Desktop/html.txt remote:/root
[/CPDE]

This will take the file1.txt from the local system and put it in the home directory of userid of the remote system. For the "remote_box" you can use its IP or hostname.

but it is not working fine.

i would like to send via E-Mail from network.
how can i know userid of the remote system.

inplace of this i given ip address(that is known ip address)
it asking his/her password.

then how can i do.

i seen this in a software(file sending)
can i tell the name of the software.

please help me

thank you in advance

theNbomr 03-23-2007 11:01 AM

You haven't said what level of programming you want to use, so I will pick the middle ground and suggest perl. The Mail::Mailer Mail::Send modules in the MailTools package are probably a good place to start. See the docs on cpan.org.

--- rod.

cfaj 03-23-2007 11:10 AM

Quote:

Originally Posted by munna_dude
hi all

i tried like this to send a file from one system to others
Code:

scp file1.txt userid@remote_box:
and also this
Code:

scp -rp /root/Desktop/html.txt remote:/root


Why are you using -r?
Code:

scp -p /root/Desktop/html.txt remote:/root
Quote:

This will take the file1.txt from the local system and put it in the home directory of userid of the remote system. For the "remote_box" you can use its IP or hostname.

but it is not working fine.

What does "not working fine" mean? What does happen? What output do you get from the command?


munna_dude 03-23-2007 11:23 PM

thank you for quick replay
 
Quote:

Originally Posted by cfaj
What does "not working fine" mean? What does happen? What output do you get from the command?


not working fine in the sense
it is asking ip address and his system password
this the problem
suppose i wanna send a file to u.
how can send?

i didnt know ur ip adress and also ur system password ...


please help me in this way

thank you in advance

indienick 03-24-2007 12:26 PM

You have to have the remote system defined in your '/etc/hosts' file.

Example:
Code:

10.42.42.2    backupserver
192.168.2.59  mailserver
...            ...
IP      Hostname by which YOU would like to reference remote system by.

Quote:

Originally Posted by munna_dude
ot working fine in the sense
it is asking ip address and his system password
this the problem
suppose i wanna send a file to u.
how can send?

i didnt know ur ip adress and also ur system password ...


please help me in this way

SCP just makes use of creating secure sockets (SSL) over intranets (local networks). In theory, you could try doing it, but in North America, unless you have a business line, or pay X amount of dollars extra per month, you will always have a dynamic IP, and thus would mean you would have to re-edit your /etc/hosts file, or somehow obtain the other person's IP address everytime they reset their WAN connection.

The only feasable way to send somebody a file across the internet is by strictly using a DNS server that the remote host is catalogued on, and the remote host running SSH and/or FTP server daemons.

Either way, a static IP is required, or some unobtrusive way of refreshing your IP/host definitions upon every WAN re-connection.

cfaj 03-24-2007 02:18 PM

Quote:

Originally Posted by indienick
You have to have the remote system defined in your '/etc/hosts' file.


No, you don't; a URL will work.
Quote:

Example:
Code:

10.42.42.2    backupserver
192.168.2.59  mailserver
...            ...
IP      Hostname by which YOU would like to reference remote system by.

SCP just makes use of creating secure sockets (SSL) over intranets (local networks). In theory, you could try doing it, but in North America, unless you have a business line, or pay X amount of dollars extra per month, you will always have a dynamic IP, and thus would mean you would have to re-edit your /etc/hosts file, or somehow obtain the other person's IP address everytime they reset their WAN connection.

There is nothing preventing anyone from using scp to copy a file to any other machine, anywhere in the world. For example, I copy files from my home machine (in Toronto, Canada) to my website (in Texas, USA) with a line like this:
Code:

scp "$HOME/file.html" cfaj@freeshell.org:
For that to work, you either need the password or have host-key authentication set up.

If you don't have either of those, you could use anonymous FTP -- if the remote machine is set up to use it.

Failing that, send it by e-mail. There are many examples of how to send files by e-mail on the web (e.g., http://www.shelldorado.com/scripts/) and in Usenet newsgroups.
Quote:

The only feasable way to send somebody a file across the internet is by strictly using a DNS server that the remote host is catalogued on, and the remote host running SSH and/or FTP server daemons.

Either way, a static IP is required, or some unobtrusive way of refreshing your IP/host definitions upon every WAN re-connection.

There is absolutely no need for a static IP. You don't need to know the IP address.

indienick 03-24-2007 03:04 PM

Thank you for the corrections, cfaj.

I was under the impression static IPs were needed because anytime my DHCP server, at home, has to restart, I begrugdingly have to manually edit all of the /ets/hosts files on all of my other machines; simply typing in the hostname as a URL has yet to work for me.

:)

munna_dude 03-30-2007 02:22 AM

thank you for quick replay
 
Quote:

Originally Posted by cfaj
There is absolutely no need for a static IP. You don't need to know the IP address.

then how can i do?
which way is the perfect to send through internet.

can you please help me

thank you in advance

munna_dude 03-30-2007 10:41 PM

thank you for quick replay
 
hi
somebudy advised me to use curl
it will work good for filr transfer through internet.
how can i use
is there any command line to send a file.

help me

thank you in advance

cfaj 03-30-2007 10:52 PM

Quote:

Originally Posted by munna_dude
then how can i do?
which way is the perfect to send through internet.


Define "send through the internet". What are you trying to do? Where do you want to send a file?

You cannot send to a machine on which you have no permissions unless that machine allows you to, e.g., by anonymous FTP.

Some machines let you upload files through a web form.

If you want to send a file to a specific person on another machine, use e-mail.

If you have a shell account on the remote machine, use scp.

Etc., etc..

ntubski 03-30-2007 11:25 PM

Quote:

Originally Posted by cfaj

No, you don't; a URL will work.

There is nothing preventing anyone from using scp to copy a file to any other machine, anywhere in the world. For example, I copy files from my home machine (in Toronto, Canada) to my website (in Texas, USA) with a line like this:
Code:

scp "$HOME/file.html" cfaj@freeshell.org:
For that to work, you either need the password or have host-key authentication set up.
...
There is absolutely no need for a static IP. You don't need to know the IP address.

But part of why that works is that freeshell.org has DNS setup. You can't just a connect a random machine to the internet, give it a random name and expect every computer in the world to know about that name automagically.

munna_dude 03-31-2007 12:14 AM

thank you for quick replay
 
Quote:

Originally Posted by cfaj


If you want to send a file to a specific person on another machine, use e-mail.

If you have a shell account on the remote machine, use scp.

Etc., etc..

yes i would like send trough e-mail.
i would like send a file to my friend, who is in my database (server).

how can i do this.somebudy said , use curl and somebudy use scp
which way is the perfect.

can you please give me an example.

thank you in advance


All times are GMT -5. The time now is 03:02 AM.