Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Moving a file from the client to a server - FTP?

Posted on 2007-11-28
11
Medium Priority
?
269 Views
Last Modified: 2010-03-30
I have a java app that produces a zip file.  After the zip file is created it needs to move the zip file from the client machine to a server.  What is the best way to move the zip file.  Is FTP the best way?
0
Comment
Question by:Jaziar
[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
  • 4
11 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 20366058
If you have a network share you can write it directly, otherwise yes
0
 

Author Comment

by:Jaziar
ID: 20366085
How would you handle it if you had a network share?  Can you show an example?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20366145
Try

new FileOutputStream("//machine_name/share_name/file");

then copy the stream
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:Jaziar
ID: 20366197
Just found out it is a solaris box, so I am guessing it will have to be FTP.  Do you have any examples of ftp code for me.  I will increase the points for you're time


0
 

Author Comment

by:Jaziar
ID: 20366199
Points increased
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20366264
>>Just found out it is a solaris box,

That doesn't make any difference if you have a mounted share:

new FileOutputStream("machine_name:/share_name/file");
0
 

Author Comment

by:Jaziar
ID: 20366304
I was told that FTP is the only way.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 20366327
No share, then


URLConnection conn = new URLConnection("ftp://username:password@solarisbox/x/y/filename");
conn.setDoOutput(true);
OutputStream out = conn.getOutputStream();
// Now write to it - path will have to exist

Open in new window

0
 
LVL 17

Expert Comment

by:contactkarthi
ID: 20366535
this tutorial here lets you to upload or download thru FTP

http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20366751
Otherwise use an FTP API such as Commons Net
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 20367762
:-)
0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

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 functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
The viewer will learn how to implement Singleton Design Pattern in Java.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 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