-1

I have stored file in my server, clients can download files via my page Home.aspx by clicking on an anchor, but i want to edit the original filename before launching download. How can i do it using an ASP.NET HttpHandler. Thanks in advance.

This is my anchor code:

 <% if (document.Path != null) { %>
                        <a id="downloadLink" runat="server" style="margin: 5px" href="<%# CONTENT_DIRECTORY_ROOT + document.Path %>">
                            <%= LanguageManager.GetValue("LABEL_DOWNLOAD") %></a>
                        <% } %>
Vervatovskis
  • 2,277
  • 5
  • 29
  • 46
  • Are the files static files in the file system or downloaded via a script? – Joachim Isaksson Sep 09 '12 at 15:32
  • possible duplicate of [ASP.NET add a httphandler to edit downloaded file name](http://stackoverflow.com/questions/12318715/asp-net-add-a-httphandler-to-edit-downloaded-file-name) – citronas Sep 09 '12 at 16:28

1 Answers1

0

Try the RewritePath(newUrl) method

HttpContext.Current.RewritePath(sUrl)

Or you could use

HttpContext.Current.Server.Transfer(sUrl)
Visual Micro
  • 1,561
  • 13
  • 26