I am new to ASP, JavaScript, and HTML, so all the help I can get would be greatly appreciated.
I am working on a project where I need to make a copy of an Excel file that a user selects from a drop down menu. The problem, one of many, I am having is in the Response.AddHeader line. If I do not put the ; before content-disposition, I get an error ' expecting ';'. If I do put it in, I get an error 'wrong number of arguments or invalid property assignment.
Here is the code I have so far:
<%@ language="javascript" %>
<%
Response.Buffer = "true";
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader ;"content-disposition", "attachment; filename=filename1";
var filename1 = Request.QueryString("file"
;
var batchid = Request.QueryString("batid"
;
var batchiddesc = Request.QueryString("desc"
;
var filename2 = "\\\\dwd-report2web\\d\\accountingdata\\journalentries\\store\\" + filename1;
var filename3 = filename2;
var tmpfilename = "\\\\dwd-report2web\\d\\accountingdata\\journalentries\\temp\\" + "tmp_" + filename1;
%>
<!--#include file = "../../../procedures/WebDevelopment/TransBatchProcess.js" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Batch Input Process</title>
<!-- Body Headings-->
<center><font face="Times New Roman" color="#000080">
<h1>FARS Accounting</h1>
<h2>Batch Input Process</h2>
</font></center>
<script language="JavaScript" type="text/javascript">
<!--
function checkFile()
{
var fso = new ActiveXObject ("Scripting.FileSystemObject"
;
{
fso.CopyFile ;"<%=filename3%>", "<%=tmpfilename%>";
fso=nothing;
Response.Flush;
Response.End;
}
}
Anyone have an idea how to get this to work and make a copy of the file?
TIA
Mike
I am working on a project where I need to make a copy of an Excel file that a user selects from a drop down menu. The problem, one of many, I am having is in the Response.AddHeader line. If I do not put the ; before content-disposition, I get an error ' expecting ';'. If I do put it in, I get an error 'wrong number of arguments or invalid property assignment.
Here is the code I have so far:
<%@ language="javascript" %>
<%
Response.Buffer = "true";
Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader ;"content-disposition", "attachment; filename=filename1";
var filename1 = Request.QueryString("file"
var batchid = Request.QueryString("batid"
var batchiddesc = Request.QueryString("desc"
var filename2 = "\\\\dwd-report2web\\d\\accountingdata\\journalentries\\store\\" + filename1;
var filename3 = filename2;
var tmpfilename = "\\\\dwd-report2web\\d\\accountingdata\\journalentries\\temp\\" + "tmp_" + filename1;
%>
<!--#include file = "../../../procedures/WebDevelopment/TransBatchProcess.js" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Batch Input Process</title>
<!-- Body Headings-->
<center><font face="Times New Roman" color="#000080">
<h1>FARS Accounting</h1>
<h2>Batch Input Process</h2>
</font></center>
<script language="JavaScript" type="text/javascript">
<!--
function checkFile()
{
var fso = new ActiveXObject ("Scripting.FileSystemObject"
{
fso.CopyFile ;"<%=filename3%>", "<%=tmpfilename%>";
fso=nothing;
Response.Flush;
Response.End;
}
}
Anyone have an idea how to get this to work and make a copy of the file?
TIA
Mike