This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Reading uploaded file in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Reading uploaded file in jsp" Watch "Reading uploaded file in jsp" New topic
Author

Reading uploaded file in jsp

Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 65
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

Joined: Jan 10, 2002
Posts: 60822
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 65
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

Joined: Jan 10, 2002
Posts: 60822
    
  65

See: FileUpload
Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 65
i looked there but failed to correct my code,
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

Jomy George wrote:i looked there but failed to correct my code,

This does not give us any useful information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading uploaded file in jsp
 
Similar Threads
array question?
How to find a if a file exists by extention only?
Regarding reading a file in a jsp
Read file line by line
Parsing a text file