Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

storing .pdf files in jsp

 
Santosh Kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

can anyone please tell me which is the best way to store the .pdf files..is it in oracle or in files...how can i open a pdf file using jsp...

plsease reply as soon as possible
[ May 29, 2005: Message edited by: Santosh Kumar ]
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It actually depends on you requirement and feasibility, though you can use LOB or BLOB to store files in database, but for me storing file in datbase would be last option to do.

I would rather prefer to store their path in datbase and will place them in file system
placing file in database makes datbase heavy and requires more table spaces for databases, consequntly every backup of DB also becomes heavy, even for viewing a file needs coding.

if you do not have to many files then you can go for it otherwise you will have to plan it carefully.


Shailesh
[ May 29, 2005: Message edited by: Shailesh Chandra ]
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can i open a pdf file using jsp...


Make a link to that pdf.
[ May 30, 2005: Message edited by: Adeel Ansari ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to serve a PDF file directly instead of providing a link, use a servlet. JSP are designed to serve character data, PDF should be served as binary data - same goes for images. There have been MANY discussions related to this in this forum.
Bill
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If u want this in simple terms,

Read the PDF in binary mode and write the contents back to the out stream which is sent to the browser, and the pdf file if associated with a reader or if the browser has the plugin installed, it will open up.
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider storing as Oracletext data type. You can store pdf, xls, word etc. Good thng is that 9i has sql that let you search these files and show resultd hightlighted etc like Google. I did a while back these things and now I am learning hard Java way to do the same thing.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Senthil B Kumar:
If u want this in simple terms,

Read the PDF in binary mode and write the contents back to the out stream which is sent to the browser, and the pdf file if associated with a reader or if the browser has the plugin installed, it will open up.


Not getting you. Could you please try to be more simple.

What I got is something irrational. You dont want to send the pdf, but you want to read the pdf and send the contents. Moreover you want the browser would open up a pdf to show those contents.

If thats all you want then, i would ask, Why?

Just to inform you a pdf file is more like an image file. Its not that simple to read the pdf. Have got the library to read the pdf file or you are making your own? If you have got some library then please share.

thanks.
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading a PDF for this purpouse doesnt needs any special library, because we are going to read it using java's binary I/O methods and write the contents back without anychange or parsing
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Senthil B Kumar:
Reading a PDF for this purpouse doesnt needs any special library, because we are going to read it using java's binary I/O methods and write the contents back without anychange or parsing


Well, then just get the binary and send it to the browser.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic