Purna Nagabhyru

Greenhorn
+ Follow
since Dec 09, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Purna Nagabhyru

Hi
Thanks for your reply. The same what you have mentioned i'm already using that in my code. But not succeded. In the previous mail i haven't posted that code, please find the total code,


//Calling file download method of FTPClient to download "abcd.pdf".

byte []afileContent = ftpClient.downloadFile("abcd.pdf");

InputStream is = new ByteArrayInputStream(aFileContent);
BufferedInputStream in = new BufferedInputStream(is);

//Storing the file on to our local machince.
FileOutputStream file =
new FileOutputStream("C:/abcd.pdf");
BufferedOutputStream out = new BufferedOutputStream(file);
int i;
out.flush();
while ((i = in.read()) != -1) {
out.write(i);
}

out.flush();
out.close();
15 years ago
Hi All
I'm trying to download a pdf files from FTPServer. I was able to download the file but when i'm trying to open the same, i'm unable to see the contents.
FYI-If the PDF file size is 735kb, i'm able to see the contents. But if the file size is 18kb, i'm unable to see the contents of the PDF File.

I'm pasting the code which i was using to download,

//The following stmt, gets the file contents in the form of byte array.

byte [] aFileContent = ftpClient.downloadFile("csfbsda.pdf");
InputStream is = new ByteArrayInputStream(aFileContent);
BufferedInputStream in = new BufferedInputStream(is);
FileOutputStream file = new FileOutputStream("C:/csfbsda.pdf");
BufferedOutputStream out = new BufferedOutputStream(file);
15 years ago