Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 01:43 PM
RickL
Guest
 
Posts: n/a
Default Help! Can't get "Save target as" to work for some file types

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..

Thanks.
  #2  
Old July 19th, 2005, 01:43 PM
Hans
Guest
 
Posts: n/a
Default Re: Help! Can't get "Save target as" to work for some file types

What type of file do you have problems with? Are you sure the file exists?

You may get a better answer in a html newsgroup since this does not seem to
be an ASP issue.

Regards
/Hans


  #3  
Old July 19th, 2005, 01:47 PM
Yan Roosens
Guest
 
Posts: n/a
Default Re: Help! Can't get "Save target as" to work for some file types

Hi Rick,
[color=blue]
> 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...[/color]

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.ContentType = "text/plain"
Response.AddHeader "Content-Transfer-Encoding", "binary;"

' Fill the Save As field with the name of the file
Response.AddHeader "Content-Disposition", "attachment; filename=backup.mdb;"

' Point to the file to be downloaded
thepath = server.mappath("/") & "\test\backup.mdb"

Set fsob = Server.CreateObject("Scripting.FileSystemObject")
set thefile = fsob.OpenTextFile(thepath)
response.BinaryWrite(thefile.ReadAll)

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

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles