Link to home
Start Free TrialLog in
Avatar of thhjr
thhjr

asked on

How to have user click on button and download file

This has to be simple, but I am tired.  I need to implement a simple common task.  When a customer clicks on a button, it needs to start a file download to them.  This is vb.net and aspx pages.  
Avatar of levyuk
levyuk

You could do it something like this.

When the user clicks the button it will do

response.redirect("file to download")

That should prompt the user to save the file.
ASKER CERTIFIED SOLUTION
Avatar of iboutchkine
iboutchkine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thhjr

ASKER

The page that contains the download buttons is labeled library.aspx.

The files download fine now, but it places the page name as the filename in the download, instead of the actual filename.

This is what I used to delineate the target file.  Is there a way to have it use test.doc instead of library.doc?

 Dim szFileName As String = Server.MapPath("/images/test.doc")