<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; JS: WinHttp.WinHttpRequest.5.1, "Время ожидания операции истекло"]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8171&amp;type=atom" />
	<updated>2013-03-22T19:59:45Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8171</id>
		<entry>
			<title type="html"><![CDATA[Re: JS: WinHttp.WinHttpRequest.5.1, "Время ожидания операции истекло"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70659#p70659" />
			<content type="html"><![CDATA[<p>решено через <strong>http.SetTimeouts(0,0,0,0)</strong></p>]]></content>
			<author>
				<name><![CDATA[Xameleon]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=8836</uri>
			</author>
			<updated>2013-03-22T19:59:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70659#p70659</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[JS: WinHttp.WinHttpRequest.5.1, "Время ожидания операции истекло"]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=70656#p70656" />
			<content type="html"><![CDATA[<p>Приветствую, коллеги! При работе с WinHttp.WinHttpRequest.5.1 возникает ошибка &quot;Время ожидания операции истекло&quot; даже при установке WINHTTP_OPTION_SEND_TIMEOUT. Лимит остается в 30 сек. Как победить это? <br /></p><div class="codebox"><pre><code>
function SendFileToURL(fileName, param, url){
   if (/Array/i.test(fileName.constructor+&quot;&quot;))
   {
for (var i=0, l=fileName.length;i&lt;l;i++)
SendFileToURL(fileName, param, url);
return;
   }
   
   var boundary = &quot;---------------------------aspuploader&quot;
   var http = new ActiveXObject(&quot;WinHttp.WinHttpRequest.5.1&quot;)
   var st = new ActiveXObject(&quot;ADODB.Stream&quot;)
   st.Type = 1
   st.Open()
   st.LoadFromFile(fileName)
   var fileBody = st.Read()
   st.Close();
   st.Open(); st.Type = 2
   st.Charset = &quot;Windows-1251&quot;
   st.WriteText(&quot;--&quot; + boundary + &quot;\r\nContent-Disposition: form-data; name=\&quot;&quot;+param+&quot;\&quot;; filename=\&quot;&quot; + fileName + &quot;\&quot;\r\nContent-Type: octet/stream\r\n\r\n&quot;)
   st.Position = 0; st.Type = 1; st.Position = st.Size
   st.Write(fileBody)
   st.Position = 0; st.Type = 2; st.Position = st.size
   st.WriteText(&quot;\r\n--&quot; + boundary + &quot;--&quot;)
   st.Position = 0
   st.Type = 1
   http.Option(7) = 1000;//WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT
   http.Option(4) = 0x3300;
   http.Option(5) = 1000;// WINHTTP_OPTION_SEND_TIMEOUT,
   http.Open(&quot;POST&quot;,url,false)
   http.SetRequestHeader(&quot;Content-Type&quot;,&quot;multipart/form-data; boundary=&quot; + boundary)
   http.Send(st.Read())
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[JSmаn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24434</uri>
			</author>
			<updated>2013-03-22T19:26:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=70656#p70656</id>
		</entry>
</feed>
