File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading uploaded file in jsp

 
Jomy George
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

i have to show the text file content in web page. user browse file and click read button.
the code that handle file is as shown below.


it works fine but it shows some file properties in begining its like "Content-Disposition: form-data; name="uploadfile"; filename="newicon_Qurey.txt"Content-Type: text/plain"

is there any easy way to remove those string from my output?

Thanks in advance...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not reading the multi-part request properly. Reading a multi-part request is actually quite involved (prior to Servlets 3, at least) and no one tries to do it on their own. Rather, they employ on of the popular 3rd-party libraries. See the FAqs for links and tips.
 
Jomy George
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Bibeault ,

could you please say where should i look for ... i searched in FAQ but not found any thing
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See: FileUpload
 
Jomy George
Ranch Hand
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i looked there but failed to correct my code,
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jomy George wrote:i looked there but failed to correct my code,

This does not give us any useful information.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic