--- In [EMAIL PROTECTED], Csongor Fagyal <[EMAIL PROTECTED]> 
wrote:
> Richard Curtis wrote:
> 
> >
> >>> Hi.
> >>>   I am trying to implement binary write code, and have it 
working 
> >>> with the code shown below (note: this is only sample code - 
this 
> >>> code would not be put into production and I am aware of the 
problems 
> >>> it currently has).  I still have one problem which has me 
stumped.
> >>>
> >>> Any file sent to the browser this way always takes the name of 
the 
> >>> running script.  Eg, so I am streaming "test.zip" but when the 
file 
> >>> save as dialog pops up, it offers the name 
of "downloadTest.asp".
> >>
> >>
> >>
> >> Try calling your script as
> >> <a href="..../downloadTest.asp?file=test.zip">
> >>
> >> It should trick your browser.
> >>
> >> - Cs.
> >
> >
> > Thanks for the advice, but unfortunately it did not work for me.
> > I have found a solution which is to set 
> > "$Response->AddHeader('Content-Disposition',"attachment; 
> > filename=test.zip");"
> >
> > This works fine in Konquerer, and Mozilla 1.1 on Linux, and on 
Windows 
> > IE, Opera, but NOT Mozilla 1.2.1.
> > I am guessing it might be a mozilla bug as mozilla names the 
> > downloadable file to be "test.zip.asp"
> >
> > Anyone got any thoughts ?
> 
> Sorry, my original post was wrong. But this one is working for me 
on all 
> browsers:
> <a 
> 
href="http://url/download.asp/filename.zip?.asp&file=filename.zip";>fi
lename.zip</a>

You shouldn't need to call the script with the filename, and it 
might not be desireable or practical. The ContentType I believe has 
worked for me. I can't remember off hand, I'd have to check the 
details at work. I know Content-Disposition is often required for 
emails though as is perfectly legit MIME.

This seems to be a general ASP problem, not just Apache::ASP. There 
are plenty of IIS ASP BinaryWrite and filename problems on 
groups.google.com (Content-disposition being one solution).

P.S. With PDFs there are additional problems with the Acrobat reader 
plug-in. One in particular was the need to set the Content-Length.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to