Hi!
I have a classic ASP site (not ASP.NET) where the user is able to download
documents. The documents are stored inside an Oracle database set up for
UTF-8 encoding. In the VB6 code (COM+) that fetches the document I have code
like this (in my asp page I have set codepage=65001 which is utf-8)
GetObjectContext("Response").AddHeader "Content-Length",
rs("DocData").ActualSize
GetObjectContext("Response").contentType = "application/octet-stream"
GetObjectContext("Response").AddHeader "Content-Disposition", "attachment;
filename=""" & rs("orgfilename") & """"
GetObjectContext("Response").BinaryWrite
rs("DocData").GetChunk(rs("DocData").ActualSize)
The problem is that if the filename contains national characters they are
not shown correct in the save as dialog. I have tried to understand the RFC
documents about content-transfere-encoding but I have so far failed making
this work.
I can get this to work in IE if I URLPathEncode the filename (normal
urlencode is not working)
GetObjectContext("Response").AddHeader "Content-Disposition", "attachment;
filename=""" & GetObjectContext("Server").URLPathEncode(rs("orgfi lename")) &
""";"
Mozilla compatible browsers do not like this. They suggest the the filename
dok.asp, which is the name of the asp file that instantiate the com+
component that do the actual download.
Would really appreciate if someone can shed some light over this (an example
would be excellent).
Sorry to crosspost this message but I'm not sure if my problems is in my
code, IIS or maybe incorrect headers.
Regards
/Hans