页面代码如下:
<body>
<form id="form1" runat="server">
<div>
<input type="file" runat="server" id="fileSelect" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> <br />
</div>
</form>
</body>
代码文件中Button1_click代码如下,其中FTPConnection是第三方组件的一个类:
protected void Button1_Click(object sender, EventArgs e)
{
FTPConnection ftp = new FTPConnection();
ftp.AutoLogin = true;
ftp.ServerAddress = "127.0.0.1";
ftp.ServerPort = 2121;
ftp.UserName = "anonymous";
ftp.Password = "";
ftp.Connect(); ftp.TransferType = FTPTransferType.BINARY;
//string fileName = fileSelect.PostedFile.FileName.ToString();
string localDir = fileSelect.Value.ToString();
int lastIndex = localDir.LastIndexOf('\\');
string fileName = localDir.Substring(lastIndex + 1);
ftp.UploadFile(localDir, fileName); ftp.Close();
}为什么只能传输4M以内的文件?怎么解决呢?求教
<body>
<form id="form1" runat="server">
<div>
<input type="file" runat="server" id="fileSelect" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> <br />
</div>
</form>
</body>
代码文件中Button1_click代码如下,其中FTPConnection是第三方组件的一个类:
protected void Button1_Click(object sender, EventArgs e)
{
FTPConnection ftp = new FTPConnection();
ftp.AutoLogin = true;
ftp.ServerAddress = "127.0.0.1";
ftp.ServerPort = 2121;
ftp.UserName = "anonymous";
ftp.Password = "";
ftp.Connect(); ftp.TransferType = FTPTransferType.BINARY;
//string fileName = fileSelect.PostedFile.FileName.ToString();
string localDir = fileSelect.Value.ToString();
int lastIndex = localDir.LastIndexOf('\\');
string fileName = localDir.Substring(lastIndex + 1);
ftp.UploadFile(localDir, fileName); ftp.Close();
}为什么只能传输4M以内的文件?怎么解决呢?求教
<httpRuntime maxRequestLength="400000" executionTimeout="3600" />
上传300M的文件也没问题了,最后一个疑问,麻烦解答
我是在本机上试验的,ftp也开在本机上,上传过程中explorer.exe占用cpu 50%左右,WebDev.WebServer.exe占用40%左右,请问这种效率如果有十个左右客户端同时上传,服务器的效率会怎样?与通常的ftp有区别么