mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
csharp: added request timeout for download
This commit is contained in:
committed by
Sergey Linnik
parent
13e243f900
commit
106d9bfed3
@ -324,6 +324,7 @@ namespace OnlineEditorsExample
|
||||
if (string.IsNullOrEmpty(path)) throw new ArgumentException("path"); // file isn't specified
|
||||
|
||||
var req = (HttpWebRequest)WebRequest.Create(url);
|
||||
req.Timeout = 5000;
|
||||
using (var stream = req.GetResponse().GetResponseStream()) // get input stream of the file information from the url
|
||||
{
|
||||
if (stream == null) throw new Exception("stream is null");
|
||||
|
||||
Reference in New Issue
Block a user