I'm having problems forcing the download of a file on a client's
website. We are linking from a Flash file to a zip file for download.
I had to change this so that we now link to an ASP file that forces
the download of the zip file. This works fine for me with IE 6 and XP
SP2, but still causes the following error for my client.
"Internet Explorer cannot download 'filename' from 'internet address'.
Internet Explorer was not able to open the Internet site. The
requested site is unavailable or cannot be found. Please try again
later."
The file is there and downloadable on some machines, but causes this
on others and I can't force users to change security settings. Any
ideas on how to resolve? |
Request for Question Clarification by
pafalafa-ga
on
13 Oct 2005 09:37 PDT
What happens if they right-click and do a "Save target as..."?
Are they still locked out of the download?
pafalafa-ga
|
Request for Question Clarification by
sublime1-ga
on
13 Oct 2005 11:19 PDT
adrok...
I suspect that, when you speak of a "forced download", you are
talking about relying on a script to automatically begin the
download, and that you don't have an alternate link set up for
people to right-click and select "Save target as", as suggested
by my colleague pafalafa-ga.
Since there are multiple reasons why a script might fail, given
the use of different browsers and unique security settings and
configurations, most sites which use an automatic download script
also provide a link, and note: "If the download doesn't start
automatically in a few seconds, please click on this link", or
something to that effect. Have you considered such a solution?
sublime1-ga
|
Clarification of Question by
adrok-ga
on
13 Oct 2005 14:15 PDT
Yes, sublime1-ga, that is basically the thing. The link is coming from
a Flash file that plays media files, so there isn't currently an html
link that the user could right-click and select "save as". I'm afraid
I may have to go to this, but I was trying to avoid it, as my client
would much prefer a more seamless process for the end user. I'm
forcing the download using VBScript code in an ASP page. I'm currently
trying to similar approaches, that essentially write out the
appropriate headers to the browser. The actual code that I'm using for
one version is below (the other uses the download feature from Persits
ASPUpload).
---------------------------------------------------------------------------
Response.Buffer = True
Const adTypeBinary = 1
Response.Clear
FilePath = "C:\Inetpub\TM_Website\" & sName
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile FilePath
ContentType = "application/zip"
Response.AddHeader "Content-Disposition", "filename=" & sName2
Response.Charset = "UTF-8"
Response.ContentType = ContentType
Response.BinaryWrite objStream.Read
Response.Flush
objStream.Close
Set objStream = Nothing
|