p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: How do we create a download application? ****


Message #1 by "Kelvin Philos" <kphilos@h...> on Thu, 14 Sep 2000 03:57:32 +0100
How do we create a download application?
I using this source 
<%
Function FileRead(byVal FILE)
	Dim strOut : strOut = ""
	Dim objFSO, FileDownload
	Set ObjFSO = Server.CreateObject("Scripting.FileSystemObject")
	Set FileDownload = ObjFSO.OpenTextFile(FILE, 1, False)
	strOut = FileDownload.ReadAll()
	FileDownload.Close
	Set FileDownload = Nothing
	Set objFSO = Nothing
	FileRead = strOut
End Function


Dim strFileToDownload, strFileContents

strFileToDownload = Request("Nmfile")
strFileContents = FileRead( strFileToDownload )

With Response
	.AddHeader "Content-Disposition" , "filename="&strFileToDownload
	.ContentType = "application/text"
	.Write strFileContents
End With
%>

but the name of file which downloaded not shown, it shows only the name
this source. How can we show the name of download file not source file?

  Return to Index