p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET Website Programming Problem-Design-Solution (http://p2p.wrox.com/forumdisplay.php?f=23)
-   -   FileManager - download function (http://p2p.wrox.com/showthread.php?t=5458)

culam October 27th, 2003 06:43 PM

FileManager - download function
the download function does not work correctly. When user try to download a file, the default name is "download.aspx". The user have to rename the file name manually, very inefficient. Can we fix this so the name of the file will appear in the "save as" dialog instead of the annoying "download.aspx".


culam October 28th, 2003 07:26 PM

I do my own research and found out the you need to add this code:
Response.Buffer = True

Have fun!

swkanode November 4th, 2003 10:57 AM

You need to change the the line in the download.aspx file from:
 Response.AddHeader("Content-Disposition", "attachment filename=" _
        & theFile.Name)
to this:
 Response.AppendHeader("Content-Disposition", "attachment; filename=""" & theFile.Name & """")
The file name was not getting read correctly.

All times are GMT -4. The time now is 11:54 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.