Hi,
I have a table in my sql server database with filename, filedata and id.
I need to give user the access to download the files stored in my database.
Kindly help me resolve this issue
Sounds like a great use of the reporting module
How to proceed ahead
Inductive University should have everything you need, here is a link to the reporting section:
?
Why the reporting module?
You just need a query and system.perspective.download()
.
I suppose I'm assuming the user that wants the data in a specific format
The OP specifies that his DB holds filedata. That implies it already is in a desired format.
Filedata implies it's in a nice format that an end user typically needs to see it? Learn something new every day!
The combination of id, filename, and filedata (or similar names) is extremely common for storing blobs in databases. It implies that the row's blob is the entire file.
{ I tend to include an origin timestamp and a content type, but I'm a pedant. }
Here I would like to give you a basic overview of wat I am trying to achieve
I have used file upload component to give user the facility to upload pdf.
The file name ,filedata (blob data) and id is getting stored in my database table once the user uploads
Now I want to give the user an ability to view and download the pdf which was uploaded
What is the feasible solution for this
The simplest solution is as described. Provide a download button that queries for the desired row, then supplies the blob data to system.perspective.download()
.
To view the PDF, you'll want to place an IFrame component and use my Blob Server module (free) to deliver the content.