aspose file tools*
The moose likes Java in General and the fly likes Problem in file uploading - XML & socket Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem in file uploading - XML & socket" Watch "Problem in file uploading - XML & socket" New topic
Author

Problem in file uploading - XML & socket

vidya archana
Ranch Hand

Joined: Oct 29, 2002
Posts: 36
We are developing a client-server web application.
We are communicating with the server through a socket using XML. We are facing a problem while uploading documents. What we are doing is,
reading the file, encoding it and send as XML.
In the server side decode it, write it into a file.
But the file is getting corrupted.
please help.
Vijayakumar Arya
Ranch Hand

Joined: Jan 27, 2003
Posts: 76
hi vidya,
Taken from your post:
reading the file, encoding it and send as XML.
In the server side decode it, write it into a file

Are you missing something, failed to extract the contents from the XML.
Sending Side: Read->Encode->Send as XML
Receiving Side: Extract From XML->Decode->Write to File.


Thanks,<p>Vijay<p>The Hand that gives, Gathers.
vidya archana
Ranch Hand

Joined: Oct 29, 2002
Posts: 36
We are doing in the same way you suggested. We are uploading it directly to one machine and another through socket using xml.
The first gets uploaded correctly, but the one send through socket is getting corrupted.
But this works for simple, and very small text files with 5-6 lines. But as the size grows larger, the file is getting corrupted.
Can you please help?
Vijayakumar Arya
Ranch Hand

Joined: Jan 27, 2003
Posts: 76
Hi Vidya,
I am not getting any hint on where could be the problem. The problem might the size that is not taken into account in any of the process. Since I am not aware of the encoding and decoding part, I suggest to try it out,
Without sending the XML you can decode and write that to a file and verify that whether this part works well. Absolutely the sockets are fool-proof, as you are able to send and receive data and there is no restriction of the size of data that has been sent.
Just verify the encoding and decoding part, that could be the culprit. Hope this helps
 
Don't get me started about those stupid light bulbs.
 
subject: Problem in file uploading - XML & socket