Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Download script problem

Status
Not open for further replies.

Dashley

Programmer
Dec 5, 2002
925
0
0
US
I'm running the code below which normally works fine.
I've recently run into a problem, when I get the download dialog box the file name is changed from "HELLO.ARM.CAB" to
"HELLO[1].ARM.CAB".

Does anyone know why the [1] is being added to my filename?

Thanks

Dan

Code:
Dim strFilePath
strFilePath = "C:\Inetpub\[URL unfurl="true"]wwwroot\PPC\HELLO.ARM.CAB"[/URL]
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile strFilePath
fn = "HELLO.ARM.CAB"
'Response.ContentType = "application/cab"
Response.ContentType = "application/octet-stream"
Response.AddHeader "Content-Disposition","attachment;filename=" & fn
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
 
Just at a guess, I'd say it is probably because the file already exists, and you haven't said that it is OK to overwrite it, so it is creating a similar, but unique, filen name.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Tracy,

Hi. Thanks. I thought that might be it and hae done several searches on the device to see if the file exists but can't find one. I've even did a hard reset on the PPC and wiped it clean but I still run into the same situation.


Dan
 
I would try hitting the page from a couple of different client computers to see if this is a server-side issue or if the browser trying to "help
 
Anytime you use IE to d/l a file it stores the file in the IE cache, then "copies" it to the d/l location you specified. It does not delete it from the cache. If you manually clear your cache, the download is still resident in your memory. If you clear the IE cache, and do a cold (power off) reboot, see if that corrects the problem.

Many times even these steps don't correct that error, and the only information I have found on it is that it is cached at the ISP level as well, which of course you have no control over.

Most websites now include a note about this effect and tell their users to delete the [1] from the destination file name.

Jim Schuuz
{ F1 = my.friend
}
 
Jim: really? I've never had that problem before, and I've never seen the note you mention about the effect. Guess I haven't been downloading as many files as I used to. I'll have to keep that in mind if I have to work on a site that needs downloads.


Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top