| Author |
downloading files using sockets
|
Alessandro Brawerman
Greenhorn
Joined: Sep 22, 2003
Posts: 22
|
|
Hi all, I'm implementing an application that downloads some files via sockets. After the download I locally save the files. The problem is that every time it includes a header before the text and don't want that to happen. I'm using the following to get the input stream: InputStream input = new BufferedInputStream(socket1.getInoutStream); Is this the problem? How to get rid of the header in the local files? Thanks, Alessandro.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
Well, I'm going to guess that your sockets are connected to a Web server, or some other Internet server that sends more than just the file back to you when you request a file. There are two things you might do. One is to parse the data from the sockets and remove the headers yourself. Another, far easier solution is to use URLConnection instead of raw sockets; it will remove the headers for you; e.g., like this.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: downloading files using sockets
|
|
|