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

How to download a file from a database using jsp

 
visu Nekk
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can anyone guide with source code of how to download a file from access database using jsp
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can you explain what you mean by "downloading a file from Access"? Last I checked Access was a sort of database (I'm hesitant to call it a full-blown database for various reasons), not a filesystem. Are you talking about retrieving data from it and storing it in a file? In that case, describe more specifically what your problem is - the JDBC part, the file I/O part, or how doing it in a JSP causes you problems.
 
visu Nekk
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Report post to moderator
i have stored a resume of type .doc in access database.when i retrieve the entire form data i need to download the resume also.i need help in downloading the resume along with other form data.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
I'm confused why you want to download "form data", because that is usually uploaded from a web browser to a web server, but since the question is mainly about downloading a file, here goes.
There are two ways to do this. Either, when the user requests the file, retrieve it from the DB, store it temporarily on the web server, and include a link to it on the repsonse page you show to the user. Or, you retrieve the file from the DB and stream it back to the user directly, while taking care to set a proper content type. If you do the latter, there will be no actual response page, so you need to communicate the other data items to the user in a different way.
 
    Bookmark Topic Watch Topic
  • New Topic