Hi Rick,
I have an ASP application that uploads a specified file to the server. To retrieve the file, I simply assign the filepath and file to a hyperlink on the page. When you click "Save Target As" for some file types, I get the following error messsage: IE can not download <file> from <server>. IE was not able to open this internet site. The requested site is either unavalable or can not be found. Can anyone tell me how to save a file of any type? It works for MS Word, Excell, text files...
I'm facing the same problem when I try to download a mdb file. I will start a thread about this issue later today.
Here is the code I have written so far. It doesn't work for mdb files (the results of the download are always corrupted Access databases), but it could work for the type of file you want to download.
<%
Response.Conten tType = "text/plain"
Response.AddHea der "Content-Transfer-Encoding", "binary;"
' Fill the Save As field with the name of the file
Response.AddHea der "Content-Disposition", "attachment ; filename=backup .mdb;"
' Point to the file to be downloaded
thepath = server.mappath( "/") & "\test\backup.m db"
Set fsob = Server.CreateOb ject("Scripting .FileSystemObje ct")
set thefile = fsob.OpenTextFi le(thepath)
response.Binary Write(thefile.R eadAll)
set fsob = Nothing
set thefile = Nothing
%>
Save this code in a Asp page without adding any html tags, and simply call this page to start the download.
I will keep on working on this code , but I'm afraid I will have to use another solution to download my mdb files (renaming them to zip files)
HTH
Yan