Restoring original filename on BLOB downlaods

P

Picho

Hi all,

I am storing binary files on MS-SQL server. my file record includes the
original filename.
I have created a web application for downloading those saved files and it
works ok besided one small issue:
when I select save-as to save my file from the web-app to the local disk,
the file gets a default filename in the form of <aspx page name>.<original
extension>

how can I restore the original filename?

thanx,

Picho
 
M

Manohar Kamath

Add a header in your ASPX page something like:

Response.AddHeader("Content-Disposition", "attachment; filename=" +
yourFileName);

You will need to do this before any content is sent back to the browser --
say in the Page_Load method.
 
P

Picho

Thanx a lot it works great!

Picho


Manohar Kamath said:
Add a header in your ASPX page something like:

Response.AddHeader("Content-Disposition", "attachment; filename=" +
yourFileName);

You will need to do this before any content is sent back to the browser --
say in the Page_Load method.
 

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

Top