This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Now this code works perfeclty with basic text files, but for images and pictures it seems to get more information than actually there, e.g a 76kb jpeg image becomes 120kb....
Any one know why this is doing this, or can point me in a better direction. I dont really want to use one of these jsp upload beans, and orielly wont work with the java version installed on the machine when program is to be run, and again is allready all there something i dont want to have Thanks in advance [ December 12, 2005: Message edited by: Al Hollis ]
You're using Readers and Writers, which are specifically meant for text only, to operate on binary data such as image files. Which are not text, so they get damaged when you do that. Change your code to use InputStreams and OutputStreams; they will work for text files as well.
Joined: Dec 12, 2005
Thank you very much was doing my head in lol.... Should have read the api's
Now i have a problem...
How big can i set my byte array...
byte line = new byte;
Does that equal 5 megs?? if so why when i upload a 1.2 meg pdf do i only recieve 78k??