moonrise
asked on
How to trigger a download of a file
I have a ISAPI program which retrieves data from a database and writes the data into a file with Comma Separated Value format. When the user triggers the execution of this ISAPI Dll, I want the user to get the file download dialog. What do I need to send instead of the existing code:
StrPCopy(vBuffer, 'Content-Type: text/html' + CrLf + CrLf +
'<HTML>' + CrLf + '<HEAD>' + CrLF + '<TITLE>Report</TITLE>' + CrLf +
'</HEAD>' + CrLf + '<BODY BGCOLOR="#FFFFFF" TEXT="#000000" BACKGROUND="yellowbk.gif"> <DIV ALIGN="CENTER"><CENTER>' + CrLf + CrLf );
I suspect I need to change the Content-Type, etc...
Thank you
StrPCopy(vBuffer, 'Content-Type: text/html' + CrLf + CrLf +
'<HTML>' + CrLf + '<HEAD>' + CrLF + '<TITLE>Report</TITLE>' + CrLf +
'</HEAD>' + CrLf + '<BODY BGCOLOR="#FFFFFF" TEXT="#000000" BACKGROUND="yellowbk.gif">
I suspect I need to change the Content-Type, etc...
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Content-Type: application/octet-stream; name=report.csv
ASKER
instead of using the file name I specify it uses the name of the DLL (ISAPI) - report.dll, any idea why?
Hmmm. Got me stumped there.
ASKER