由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Windows版 - IIS7.5 大于 64KB 文件不能下载 ? (转载)
相关主题
Re: Where to download free ghostscript?Re: 如何在NT中加一个自动启动的程序?以一个普通用户运行,不是Administra
Re: 微软升级联不通,谁能给我一个winxp中文板patch?!用软件实现win2000 pro版 变 win2000 server版
VS 2005 expressRe: XP Home 是不是没有IIS?
一台电脑的两个操作系统My Experience to connect computer at home.
one more question - how to download this audio?Re: 关于inetinfo.exe??
还有一个关于Privacy Safeguard BHORe: IIS and .NET
Excel VSTO 4.0 project deveopled in VS2010 migration to VSTO 5.0 developed in VS2013Re: pls help with IIS problem
Re: how to set up 2 ftp sites on 1 machine in win2000 pro?Re: [转载] 关于localhost的问题
相关话题的讨论汇总
话题: url话题: 64kb话题: file话题: my话题: c#
进入Windows版参与讨论
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));
}
}
}
}
1 (共1页)
进入Windows版参与讨论
相关主题
Re: [转载] 关于localhost的问题one more question - how to download this audio?
Re: XP Home IIS还有一个关于Privacy Safeguard BHO
Re: More suggestions! Re: XP Home IISExcel VSTO 4.0 project deveopled in VS2010 migration to VSTO 5.0 developed in VS2013
Re: 哪里下载XP HomeEdition用的IIS?Re: how to set up 2 ftp sites on 1 machine in win2000 pro?
Re: Where to download free ghostscript?Re: 如何在NT中加一个自动启动的程序?以一个普通用户运行,不是Administra
Re: 微软升级联不通,谁能给我一个winxp中文板patch?!用软件实现win2000 pro版 变 win2000 server版
VS 2005 expressRe: XP Home 是不是没有IIS?
一台电脑的两个操作系统My Experience to connect computer at home.
相关话题的讨论汇总
话题: url话题: 64kb话题: file话题: my话题: c#