Dynamically Generating a File for Download

G

Guest

I have some sensitive data encrypted in a database. I need to allow the authorized people to produce a report (obviously, unencrypted) that they can send to the appropriate partners. Can I set it up so they can download a .csv of the data without actually producing the csv and saving it on the server side?

I suppose the best description would be that on the client side, there's a link on a web page that looks like it links to the csv, but the csv is dynamically generating and served when they click on it. Client can save it on their side, but no actual csv is saved on the server side. Somehow the data is streamed to the client directly from the database throug the decryption algorithm.

Any thoughts? Thanks.

Jerry
 
J

Jester98x

I have some sensitive data encrypted in a database. I need to allow the authorized people to produce a report (obviously, unencrypted) that they can send to the appropriate partners. Can I set it up so they can download a .csv of the data without actually producing the csv and saving it on the server side?

I suppose the best description would be that on the client side, there's a link on a web page that looks like it links to the csv, but the csv is dynamically generating and served when they click on it. Client can save it on their side, but no actual csv is saved on the server side. Somehow the data is streamed to the client directly from the database throug the decryption algorithm.

Any thoughts? Thanks.

Jerry


Jerry,

More of a pointer than a step by step guide.

You can generate a text page, csv file, and return that to the user in
the same way you would a html page, however in the code that returns
the response to the user, change the mimetype of the page to the type
relevant to a csv file, you can also provide information as to the name
of the file if you wish. This is something I have done in the past for
returning data to the user as CSV or Excel files just by manipulating
the mimetype. Unfortunatly I don't have the code to hand, or the exact
details to answer your query. I think the Response object lets you
manipulate the mimetype of the response sent back to the browser.

Steve
 
W

Walter Wang [MSFT]

Hi,

I think you can refer to following KB as an example:

#HOW TO: Read and Write BLOB Data by Using ADO.NET Through ASP.NET
http://support.microsoft.com/kb/326502

Although it's reading data from database using ADO.NET, I think the idea is
alike: you could just decrypt the data in memory and write the result byte
array to the Response.

Please let me know if you need further information on this post. Thank you.

Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
arinsharma
Top