由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - IIS7.5 大于 64KB 文件不能下载 ? (转载)
相关主题
tinyurl 是怎么做到同一个long url两次得到相同的short url咋用python做一个3D surface plot? 请教
Perl 问题 (updated)visual c++ project property设置问题
vb.netvs2010 beta test 出来了 (转载)
Using EXCEL VBA to download information from websitefrom VS2010 project, how to generate msbuild script directl (转载)
URL questionsAnyone ever ran into a "fatal error LNK1168" in MS VS studi
请教一个语言选择的弱问题windows 7 下面大家都用什么C编程软件?
问一道面试题关于C++ 0X的多线程库
Random Switch Between Two Different URLsC++ 下载版本
相关话题的讨论汇总
话题: 64kb话题: url话题: file话题: my话题: desktop
进入Programming版参与讨论
1 (共1页)
l******9
发帖数: 579
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: IIS7.5 大于 64KB 文件不能下载 ?
发信站: BBS 未名空间站 (Tue Jun 23 12:47:53 2015, 美东)
大于 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));
}
}
}
}
c*********e
发帖数: 16335
2
你的这个web services,是soap,还是restful?

64KB
desktop
URL

【在 l******9 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: light009 (light009), 信区: JobHunting
: 标 题: IIS7.5 大于 64KB 文件不能下载 ?
: 发信站: BBS 未名空间站 (Tue Jun 23 12:47:53 2015, 美东)
: 大于 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.

a**y
发帖数: 335
3
web.config设置有问题吧。是wcf么? 如果是要把限制改大。both server and client
side。

64KB
desktop
URL

【在 l******9 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: light009 (light009), 信区: JobHunting
: 标 题: IIS7.5 大于 64KB 文件不能下载 ?
: 发信站: BBS 未名空间站 (Tue Jun 23 12:47:53 2015, 美东)
: 大于 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.

l******9
发帖数: 579
4
我不是这个 application 的开发人。
我知道 REST and SOAP.
但是不知道如何在代码里区分它们, REST 只是一种 architectural style。 SOAP
只是一种 protocol 。
我的 application service (published by IIS 7。5 to my desktop)
发布成功后, 交给用户的是一个 URL 指向我的 desktop 的一个文件夹。
用户可以从这个链接 下载并安装 这个 application 工具。 这个工具 有GUI, 可以
从的指向的文件夹 下载文件。
但是, 文件大于 64KB 就不能下载 或者只下载 64KB。
I got error:
connection was forcibly closed by remote server
on my laptop (client side), and
error 504 gateway timeout
on my desktop (server side).
我在IIS 7.5 manager, ASP property 里面 更改了
client connection test interval = 00:10:00
max requesting entity body limit = 1073741824
response buffering limit = 1073741824
request queu timeout = 00:10:00
script timeout = 00:10:00
in my web.config
requestLimits maxAllowedContentLength="104857600"
I used the same setting for the desktop's applicationHost/weblimits
properties.
可是依然不能解决问题。
Any help would be appreciated.

client

【在 a**y 的大作中提到】
: web.config设置有问题吧。是wcf么? 如果是要把限制改大。both server and client
: side。
:
: 64KB
: desktop
: URL

a**y
发帖数: 335
5
开fidder看过吗?

【在 l******9 的大作中提到】
: 我不是这个 application 的开发人。
: 我知道 REST and SOAP.
: 但是不知道如何在代码里区分它们, REST 只是一种 architectural style。 SOAP
: 只是一种 protocol 。
: 我的 application service (published by IIS 7。5 to my desktop)
: 发布成功后, 交给用户的是一个 URL 指向我的 desktop 的一个文件夹。
: 用户可以从这个链接 下载并安装 这个 application 工具。 这个工具 有GUI, 可以
: 从的指向的文件夹 下载文件。
: 但是, 文件大于 64KB 就不能下载 或者只下载 64KB。
: I got error:

1 (共1页)
进入Programming版参与讨论
相关主题
C++ 下载版本URL questions
VC# com 调用 matlab 报错请教一个语言选择的弱问题
关于Function Pointer的简单问题,望指教问一道面试题
perl lwp打不开webRandom Switch Between Two Different URLs
tinyurl 是怎么做到同一个long url两次得到相同的short url咋用python做一个3D surface plot? 请教
Perl 问题 (updated)visual c++ project property设置问题
vb.netvs2010 beta test 出来了 (转载)
Using EXCEL VBA to download information from websitefrom VS2010 project, how to generate msbuild script directl (转载)
相关话题的讨论汇总
话题: 64kb话题: url话题: file话题: my话题: desktop