1 2 3 Previous Next 30 Replies Latest reply: Jan 20, 2009 2:01 PM by jschellSomeoneStoleMyAlias RSS

    Send and receive a zipped file with a character/text stream??

    Hugo Tigre
      Hi,

      Currently i need to configure my software to receive a zip file that is sent to me through sockets, i have no control over the senders application, but what i have discover so far is that it sends everything in text (even the binaries numbers that is supposed to send is sending then in text).

      I manage to work around this on everything except the file, i tested with a txt file (the senders application sends both a txt and a zip file) and it works great, but with a zip file, does not.

      I think the problem may be with the character set, but i have no idea how to test or work around this.

      I don't need to unzip the file or anything, just save the file, theoretically if the file was sent to me using a primitive type data stream i could receive the file the same way even if i couldn't read what was inside the file.

      Right now i'm reading the file with a InputSteamReader, saving the data in a char array, and saving the file with:
      PrintWriter fileOut = new PrintWriter(new FileOutputStream("c:\\some_dir\\"+fileName));
      I receive the complete file, and can save it in the hardrive, but the zip integrity is compromised (damaged zip archive).

      Any Ideas?

      Any help would be appreciated, if i wasn't clear enough or more input is needed, please tell me.

      Best Regards
        1 2 3 Previous Next