|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
download files and change name
Originally posted by : Nagano (pere@creus.net)I'm creating a program to download a file from a server by using the following code:-------------------------------------------------set fs = CreateObject("Scripting.FileSystemObject")Set ts = fs.OpenTextFile(Server.MapPath(PathAbsolut & Link), 1, False, -1)Response.Buffer = TRUEResponse.ContentType = tipusdo while not ts.AtEndOfStream Response.BinaryWrite ts.Read(4096)loopts.Closeset fs = nothingResponse.End-------------------------------------------------the problem is that every file I download is named "download.asp", the name of the asp file I'm using.How can I modify that so I can rename every file I send?thanks.
|
|
#2
|
|||
|
|||
|
Originally posted by : Dave (david@sbmc.com.au)Try using the following before the ContentType lineResponse.Addheader "Content-Disposition", "; filename=" & "myFile.txt"------------Nagano at 8/3/2001 10:24:05 AMI'm creating a program to download a file from a server by using the following code:-------------------------------------------------set fs = CreateObject("Scripting.FileSystemObject")Set ts = fs.OpenTextFile(Server.MapPath(PathAbsolut & Link), 1, False, -1)Response.Buffer = TRUEResponse.ContentType = tipusdo while not ts.AtEndOfStream Response.BinaryWrite ts.Read(4096)loopts.Closeset fs = nothingResponse.End-------------------------------------------------the problem is that every file I download is named "download.asp", the name of the asp file I'm using.How can I modify that so I can rename every file I send?thanks.
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > download files and change name |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|