Solved

transfer files using FTP

Posted on 2006-11-06
11
254 Views
Last Modified: 2010-03-31
Dear experts

I have two machines , Machine A and Machine B. From Machine A , I have to transfer a file in a directory  of Machine B.
I am using FTP Server in machine B. Any ideas  how I can do that?

Do i need to use Java or can i use some FTP commands to get the job done?


Thanks
J
0
Comment
Question by:jaggernat
  • 6
  • 3
  • 2
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 17882141
>>Do i need to use Java or can i use some FTP commands to get the job done?

That depends on a lot of things. Are the machines on the same network? If they are, you don't necessarily need FTP
0
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 17882166
You can use jakarta commons-net to do ftp opertions

http://jakarta.apache.org/commons/net
0
 
LVL 10

Author Comment

by:jaggernat
ID: 17882183
yes , i can access directories of Machine B in Machine A (they are in network)
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 86

Expert Comment

by:CEHJ
ID: 17882224
Just copy them directly then


File remote = new File("\\\\servername\\sharename\\filename");

Write in the normal way
0
 
LVL 10

Author Comment

by:jaggernat
ID: 17882261
any idea whats the FTP command to copy the file from Machine A to Machine B ?

thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17882281
put
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 17882282
(But as i said, you shouldn't need FTP)
0
 
LVL 23

Assisted Solution

by:Ajay-Singh
Ajay-Singh earned 100 total points
ID: 17882289
> any idea whats the FTP command to copy the file from Machine A t
checkout this: http://wiki.apache.org/jakarta-commons/Net/FrequentlyAskedQuestions
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 17882334
For simply putting a file you don't need a special API. You can use


       URL ftp = new URL("ftp://username:password@69.194.83.97/asdsa.txt");
       URLConnection conn = ftp.openConnection();
       conn.setDoOutput(true);
       PrintWriter out = new PrintWriter(conn.getOutputStream());
       out.println("How's that");
       out.println("krupini?");
       out.close();
0
 
LVL 10

Author Comment

by:jaggernat
ID: 17882642
thanks guys, let me see whats the appropriate solution and i'll get right back..
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18001457
:-)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java DateChooser? 3 36
Apps blocked by Java 9 79
table example 4 29
ejb on wildfly 5 20
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question