T
twiggy182
Hi,
I really need you help because I'm not very familliar with ASP and I
could not find any solution to my problem.
To put you in situation, I have a CGI to which I send a file name, and
that script return me that file. But for security reason, I don't want
to publish the address of this CGI, so I encapsulated it in an ASP
file. This way, only this ASP file knows where the CGI is.
Here is my code :
<%
Server.ScriptTimeout = 1000 * 1000
url = "http://address.to.cgi?search_file=" & request("search_file")
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
ResolveTimeout = 5 * 1000
ConnectTimeout = 5 * 1000
SendTimeout = 60 * 1000
ReceiveTimeout = 60 * 1000
xmlhttp.setTimeouts ResolveTimeout, ConnectTimeout, SendTimeout,
ReceiveTimeout
xmlhttp.open "GET", url, false
xmlhttp.send ""
respContentType = xmlhttp.getResponseHeader("content-type")
Response.ContentType = xmlhttp.getResponseHeader("content-type")
Response.AddHeader "Content-Disposition",
xmlhttp.getResponseHeader("content-disposition")
Response.binaryWrite xmlhttp.responseBody
set xmlhttp = nothing
%>
The problem is that each time I try to copy a file bigger than 20Mb, I
get a "The page cannot be displayed". My script is failing at the
"Response.binaryWrite" because if I replace it by ' Response.write
"Hello World" ' , it works.
I try to break down the xmlhttp.responseBody and send it in many chunk
but I don't know how to do that
Any suggestion?
Thanks in advance
I really need you help because I'm not very familliar with ASP and I
could not find any solution to my problem.
To put you in situation, I have a CGI to which I send a file name, and
that script return me that file. But for security reason, I don't want
to publish the address of this CGI, so I encapsulated it in an ASP
file. This way, only this ASP file knows where the CGI is.
Here is my code :
<%
Server.ScriptTimeout = 1000 * 1000
url = "http://address.to.cgi?search_file=" & request("search_file")
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
ResolveTimeout = 5 * 1000
ConnectTimeout = 5 * 1000
SendTimeout = 60 * 1000
ReceiveTimeout = 60 * 1000
xmlhttp.setTimeouts ResolveTimeout, ConnectTimeout, SendTimeout,
ReceiveTimeout
xmlhttp.open "GET", url, false
xmlhttp.send ""
respContentType = xmlhttp.getResponseHeader("content-type")
Response.ContentType = xmlhttp.getResponseHeader("content-type")
Response.AddHeader "Content-Disposition",
xmlhttp.getResponseHeader("content-disposition")
Response.binaryWrite xmlhttp.responseBody
set xmlhttp = nothing
%>
The problem is that each time I try to copy a file bigger than 20Mb, I
get a "The page cannot be displayed". My script is failing at the
"Response.binaryWrite" because if I replace it by ' Response.write
"Hello World" ' , it works.
I try to break down the xmlhttp.responseBody and send it in many chunk
but I don't know how to do that
Any suggestion?
Thanks in advance