• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Invoke files using Servlet

 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm developing a Search Engine. Actually what i have to do is that, i should search for the file using the keyword specified. The Matching result should be listed to the user, On clicking the result the particular file should be invoked.

The file are located within a folder (say SAPFiles), i'm maintaining the information about the file in a Oracle database. These information are loaded into the database manually. The various file information are File_ID,File_NAME,FILE_EXTENSIN,DATE_CREATION,DATE_MODIFIED,KEYWORDS,PATH.

The Keyword field holds the meta data about the file and path holds the path.

Actually i want to know how make my servlet invoke the file using the PATH and other information which are in the database.

I'm using J2EE Application Server 1.3.1 to deploy my servlets.

Can anyone help on this please...

With kind regards
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just build hyperlinks to the files in your results page.
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swaminathan,

You could directly put the link to that file in your result page,

But if you want more secure and well controlled application,
Don't put the files under directly accessible web path.

Instead, add a column MIME-TYPE to your database table, and have a servlet read the files and write the contents to HttpResponse. Ofcourse, put the MIME-TYPE in header.
 
Swaminathan Balasubramani
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u so much...

I need some more technical information...

I'm not aware..how to map the file with the path directly. I would also like to know how to implement the same with MIME-Type and servlet...enforcing security...

Please help me explanation and syntax...if u have done this before pls also help me with the sample code...

Thanking in advance for the anticipated reply...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure you don't intend to give this impression, but it looks like you are asking the assembled experts of this forum to design an application for you.
Personally, I get $75/hr for this sort of work.
My advice is to start small - try to make a standalone application first, trying to start with a servlet will just complicate things.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic