Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

transfer files using FTP

Posted on 2006-11-06
11
Medium Priority
?
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 400 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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

636 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