I want to upload either image or pdf or doc files(etc) in database with its extension.
Say suppose if i upload an text file, its extension .txt should be stored in one of the columns. How can i do that?
store the file as BLOB and the extension as varchar column in the table? You just need to strip off the extension and store it in the varchar column. Not really sure why you want to store the file extension though.
Joined: Jun 29, 2011
I am able to store files in the database. The fields in the database are id, name( of the file as varchar), type(file extension as varchar) and content(as blob).
While retrieving from database, i want to display just the id, name and extension in jsp page in table form. That can be done very easily.
But what i want to do is when the name(that is displayed) is clicked, the file should open. any idea on how i can do that.