permaculture playing cards
The moose likes I/O and Streams and the fly likes uploading files in http Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "uploading files in http" Watch "uploading files in http" New topic

uploading files in http

Dhandu Subrama

Joined: Jan 28, 2003
Posts: 1
We are trying to upload doc (ms word document) or text files with and without graphics using servletinputstream. The upload is okay whereas when you view the uploaded file it looks garbled, whereas zips, pdf and ini files are okay.
Content-Disposition: form-data; name="FILE1"; filename="C:\Data\mydoc.doc" Content-Type: application/msword
��� � > �� ! # ���� ��������������������������������������������������
Can someone sugguest a way to exporting the doc and text files without corrupting it. One of the reasons to used servletinputstream to accomadate very large size upto 1 to 2 GBytes.
Any help is appreciated,
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
zip the doc and send it! :-)
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Are you viewing the uploaded file using Word, or some other program? The "text" you show looks a lot like you're viewing a valid Word document using a plain text viewer (like notepad or vi). That won't work. Your doc is probably fine; you just need the right viewer.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: uploading files in http
It's not a secret anymore!