Solved

Ftp

Posted on 2001-06-26
4
218 Views
Last Modified: 2010-03-31
I am building an FTP Client Program using Java. It is working fine for text files. But for other documents it is not downloading properly.. Though ive set the type to I or A accordingly. I got this source from some site. It basically uses LineNumberReader for reading from the input stream.
I tried DataInputStream, it is very slow and once again not downloading the whole file.
Does anybody have any suggestions as to what kind of io streams that can be used..
Any help will be welcome...
Thank you
vg
0
Comment
Question by:vglaxmi2001
[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
  • 2
4 Comments
 

Author Comment

by:vglaxmi2001
ID: 6227953
Ok. I have pasted the download section of my code here...
Hope somebody can help.


int data = 0;
FileWriter f = new FileWriter(file);
InputStreamReader BIN = new InputStreamReader( ds.getInputStream() );
DIN  = new LineNumberReader(BIN);
while((data = DIN.read()) != -1){
    f.write(data);
    f.flush();
}
f.close();


Thanks and regards
vg
0
 

Author Comment

by:vglaxmi2001
ID: 6229098
Well I have used plain InputStream instead of DataInputStream and it works fine with the Ftp server running on my system, but not with a remote server!!!!!!
The downloaded files are bigger now!!!!!!!
SOS.. Somebody Please help :-(
0
 
LVL 5

Expert Comment

by:vemul
ID: 7616584
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- To be deleted and points refunded
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 7639863
PAQ'd and points refunded

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
ejb on wildfly 5 63
Notify sent to other threads in Java 9 54
ArrayList Adding/settign data 3 37
How to fix  socket closed error 11 64
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

739 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