由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - IIS7.5 大于 64KB 文件不能下载 ?
相关主题
突击面试CS PhD 找工作
R 问题某大公司面试题
CS 面试题总结(1)Bing vs Google search (性能比较?)
新鲜面试题大家leetcode的test case都过得去么?我的怎么经常不成?
vs2010 beta test 出来了 (转载)请教一个指针的面试题
在线紧急求助一道system design面试题,面经内附g电面,新鲜面经
攒人品 报BB面经问一个C++的小细节,和leetcode也有关
贴华人版程序员简历,大家帮忙拍砖成印度版leetcode大侠, compile time limit exceed 一般都是什么原因 引起的
相关话题的讨论汇总
话题: url话题: 64kb话题: file话题: my话题: c#
进入JobHunting版参与讨论
1 (共1页)
l******9
发帖数: 579
1
大于 64KB 文件不能下载 (from C# code). 大于 文件不能完全下载, 只能下载 64KB
, 然后
truncated. Why ?
I have published a web service application (C# built in VS2010) to a desktop
with IIS 7.5 win7.
The web service has been hosted successfully on win 7.
Now I can install the application on my laptop (win 7) by accessing the URL
http://myDesktopName.domain.com/MyApp/MyAppSetup.msi
pointing to a physical location in desktop
E:myPathmyAppmyAppService.svc
Now, in my application, I need to download (from C# on my laptop) a .dat
file from my desktop to my local laptop by visiting the URL. The downlod
function is
webclient.downloadfile(URL, myLocalFileName)
https://msdn.microsoft.com/en-us/library/ms144194%28v=vs.110%29.aspx.
The URL is
"http://myDesktopName.domain.com/MyApp/download.ashx?cmd=download&type=db&name=myDatasbase.dat"
But, the downloaded file size is not correct. Sometimes, it is 0. Sometimes,
it is 64KB. But, the original size s 4,000 KB.
If the file size is larger than 64KB, none of them can bne downloaded. I got
error:
**connection was forcibly closed by remote server**
on my laptop, and
**error 504 gateway timeout**
on my desktop.
The file is binary and is not readable in any text editor.
If I download the file from IE by visiting the same URL in address bar, the
file can be downloaded correctly.
Why the file cannot be downloaded correctly from my application if it is
larger than 64 KB? I have set up minbytepersec as 0 in IIS on my desktop and
set worker process as 8 for the application pool. And, increase timeout to
10 minutes.
Is this a bug of win 7 ? because I found this at
https://support.microsoft.com/en-us/kb/919797?wa=wsignin1.0
but, it is about win server 2003. My OS is win 7.
I have done a lot of search about the error of 504 and connection-closed by
remote server, but none of them work.
In the IIS manager, ASP limit,
max requesting entity body limit = 1073741824 // 1024 MB
max allowed content length = 30000000 bytes // 28 MB
I think it should be large enought to download a 4MB file.
But, it still failed for any file size > 64 KB.
this is C# code ran at VS2010.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Diagnostics;
namespace datafile_updownload
{
class Program
{
static void Main(string[] args)
{
try
{
WebClient _client;
_client = new WebClient();
// download
// An ASP.net web service has been published on my myDesktopName
with IIS7.5
string url = "http://myDesktopName.domain.com/MyApp/download.ashx?cmd=download&type=db&name=myFile";
Uri uri = new Uri(url);
string tmp = @"C:\Temp\aFile.dat";
_client.DownloadFile(uri, tmp); // **if file size > 64KB**, **
exception jumped out here,**
// Unable to read data from the transport
connection: An existing connection was
// forcibly closed by the remote host.
// System.Net.WebExceptionStatus.UnknownError
}
catch(WebException ex)
{
Console.WriteLine("This program is expected to throw
WebException on unsuccessful run." +
"\n\nException Message :" + ex.Message);
Console.WriteLine("Status : {0}", (ex.Status));
Console.WriteLine("Response: {0}", (ex.Response));
}
}
}
}
1 (共1页)
进入JobHunting版参与讨论
相关主题
leetcode大侠, compile time limit exceed 一般都是什么原因 引起的vs2010 beta test 出来了 (转载)
请问leetcode 上那道Longest Consecutive Sequence题在线紧急求助一道system design面试题,面经内附
一道大数据的题,讨论一下攒人品 报BB面经
面试: Take home project贴华人版程序员简历,大家帮忙拍砖成印度版
突击面试CS PhD 找工作
R 问题某大公司面试题
CS 面试题总结(1)Bing vs Google search (性能比较?)
新鲜面试题大家leetcode的test case都过得去么?我的怎么经常不成?
相关话题的讨论汇总
话题: url话题: 64kb话题: file话题: my话题: c#