*
The moose likes JSP and the fly likes upload 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 » JSP
Bookmark "upload in jsp" Watch "upload in jsp" New topic
Author

upload in jsp

Avishek Kar
Greenhorn

Joined: May 08, 2007
Posts: 4
i want to upload a .doc file in jsp and want to show that uploaded .doc file
in next page in the browser.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41154
    
  45
JSPs are not meant for this kind of thing; use a servlet instead that can handle the upload at the server side, and which then forwards the request to a JSP which can show the result. The Jakarta Commons FileUpload library can handle the file upload part.


Ping & DNS - my free Android networking tools app
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

See this entry in our Servlets FAQ.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Avishek Kar
Greenhorn

Joined: May 08, 2007
Posts: 4
I have uploaded doc file in database and want to fetch it and show it as html
can anybody provide me the source code for the same.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60806
    
  65

Originally posted by Avishek Kar:
can anybody provide me the source code for the same.

JavaRanch is a learning site. As such, you write your own code with our help.

So what have you got so far?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Avishek Kar:
I have uploaded doc file in database and want to fetch it and show it as html
can anybody provide me the source code for the same.


If you mean by 'doc file' a Microsoft Word document, then you can't.
Not with JSP alone anyway.

There are third party libraries such as POI for working with Microsoft Office formats from Java. You might need to look into one of those.
If you can reasonably expect your users to have Microsoft Office or something that can work with Office files (Like Open Office), then you might consider writing a servlet that streams the document, as is, to the browser.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: upload in jsp
 
Similar Threads
file upload using java
Opening File Chooser in a jsp Page?
How to write the code to upload images?
word - txt upload help
Netscape Navigator:Upload Problem