bdana22
08-08-2003, 10:48 AM
I'm trying to make a word Document downlodable from the protected Intranet. Here is the code I'm using:
<%@ Language=Javascript%>
<%Response.Buffer=true%>
var ApplicationName = "PerformanceReview";
var ApplicationTitle = "Performance Review";
%>
<%
var objStream = Server.CreateObject("ADODB.Stream");
objStream.Type = 1; //adtypeBinary
objStream.Open;
var PERFORMANCE_REVIEW_DOC ="D:\\Edev.ASCOValveNet.com\\Intranet\\Applications\\PerformanceReview\\Doc\\";
var fName= PERFORMANCE_REVIEW_DOC + Request.QueryString("fName")+ ".doc" ;
objStream.LoadFromFile(fName);
Response.Clear;
Response.ContentType="application/doc";
//Use this Code in case you want to force user to download the file.
//Response.AddHeader "content-disposition", "attachment;filename=filename.doc"
Response.BinaryWrite(objStream.Read());
ObjStream.Close ;
objStream=null;
Response.End();
%>
I'm calling this from another asp page:
<input type="submit" value=" Salaried Employees " name="B1"
onClick="location.href='PerformanceReview.asp?fname=3447r4'">
It gives a warning before I can save it (I want to avoid that ), and when I bypass thes message & click "SAVE", next window "SAVE AS" does not put automatically .doc extension. Can you help? Thanks
<%@ Language=Javascript%>
<%Response.Buffer=true%>
var ApplicationName = "PerformanceReview";
var ApplicationTitle = "Performance Review";
%>
<%
var objStream = Server.CreateObject("ADODB.Stream");
objStream.Type = 1; //adtypeBinary
objStream.Open;
var PERFORMANCE_REVIEW_DOC ="D:\\Edev.ASCOValveNet.com\\Intranet\\Applications\\PerformanceReview\\Doc\\";
var fName= PERFORMANCE_REVIEW_DOC + Request.QueryString("fName")+ ".doc" ;
objStream.LoadFromFile(fName);
Response.Clear;
Response.ContentType="application/doc";
//Use this Code in case you want to force user to download the file.
//Response.AddHeader "content-disposition", "attachment;filename=filename.doc"
Response.BinaryWrite(objStream.Read());
ObjStream.Close ;
objStream=null;
Response.End();
%>
I'm calling this from another asp page:
<input type="submit" value=" Salaried Employees " name="B1"
onClick="location.href='PerformanceReview.asp?fname=3447r4'">
It gives a warning before I can save it (I want to avoid that ), and when I bypass thes message & click "SAVE", next window "SAVE AS" does not put automatically .doc extension. Can you help? Thanks