You can use Response.WriteF ile to send a file from the file system without
telling the browser its path. Call the routine from the onclick event of a
server control.
' Calculate the filename by taking everything after the final slash
strPDFname = strFilepath.Sub string(strFilep ath.LastIndexOf ("/")
+ 1)
strFileExtensio n =
strFilepath.Sub string(strFilep ath.LastIndexOf (".") + 1)
' Set up the response headers for a PDF download
Response.Clear( )
Response.ClearH eaders()
Response.ClearC ontent()
' Create a suggested filenname for the downloaded document
(short - not the whole path)
Response.AddHea der("Content-Disposition", "attachment;fil ename="
& strPDFname)
'Write the file to the browser and end the HTML content
Response.WriteF ile(Server.MapP ath(strFilepath ))
Response.End()
"R.A." <te**@citsecure .com> wrote in message
news:el******** ******@TK2MSFTN GP12.phx.gbl...
Hi
In the web site I work on I give the users an option to download files
from
the web server. They click a button and I use the
Response.Redire ct("filename.ex e"). The problem is that the user migth see
the downloaded file url. Is there a way to hide the downloaded file url
(it
shows in the ie taskbar). Server.Transfer doesn't work for this.
Thanks