我在这里遇到了一些问题。我的任务是将旧应用程序从旧服务器转移到新服务器。一些配置后一切都很好,直到我注意到应用程序不想再工作了。
好吧,我可以登录并下载文件,这很完美,但是如果我尝试上传一些文件,一切都会出错。即使我重新启动服务器或回收应用程序池,我也无法再上传。
我发现,如果我直接在服务器中打开浏览器并尝试通过 localhost 登录并上传一些文件,应用程序开始工作,之后就可以在任何 oder PC 上使用它,但只是一段时间,比如 20 分钟,之后就不再工作了......
我真的对此感到困惑,因为就像我说的那样,我可以(随时)登录和下载文件,但是如果我尝试上传一些东西,我必须先到服务器并通过 localhost 运行应用程序,然后就开始了在职的...
该服务器是带有 IIS8 的新 2012,在 .Net 4.5 经典下运行(当我选择集成时它根本不起作用)。
这是 HTTP 日志的一部分:
#Software: Microsoft HTTP API 2.0
#Version: 1.0
#Date: 2013-06-25 16:28:18
#Fields: date time c-ip c-port s-ip s-port cs-version cs-method cs-uri sc-status s-siteid s-reason s-queuename
2013-06-25 16:28:18 ::1%0 49188 ::1%0 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:28:18 ::1%0 49196 ::1%0 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:28:22 ::1%0 49197 ::1%0 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:29:18 24.134.210.170 52690 10.10.10.100 80 HTTP/1.1 POST /DownloadManager/DMUpload.aspx?folderId=22767&guid=612219520&cancel=1 - 1 Timer_ConnectionIdle .NET+v4.5+Classic
2013-06-25 16:31:24 24.134.210.170 52693 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:31:29 24.134.210.170 52750 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:31:29 24.134.210.170 52749 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:33:39 ::1%0 49201 ::1%0 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:33:49 ::1%0 49212 ::1%0 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:33:54 ::1%0 49213 ::1%0 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:34:10 24.134.210.170 52766 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:37:46 24.134.210.170 52799 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:37:46 24.134.210.170 52767 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:37:46 24.134.210.170 52764 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:37:46 24.134.210.170 52794 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:47:48 24.134.210.170 52916 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 16:47:54 24.134.210.170 52917 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:00:27 24.134.210.170 53004 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:12:26 24.134.210.170 53123 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:12:31 24.134.210.170 53124 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:12:31 24.134.210.170 53126 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:13:04 24.134.210.170 53152 10.10.10.100 80 HTTP/1.1 POST /DownloadManager/DMUpload.aspx?folderId=22767&guid=289442538&cancel=1 400 1 BadRequest .NET+v4.5+Classic
2013-06-25 17:13:21 24.134.210.170 53152 10.10.10.100 80 HTTP/1.1 POST /DownloadManager/DMUpload.aspx?folderId=22767&guid=289442538&cancel=1 400 1 Connection_Dropped .NET+v4.5+Classic
2013-06-25 17:15:50 24.134.210.170 53161 10.10.10.100 80 HTTP/1.1 POST /DownloadManager/DMUpload.aspx?folderId=22767&guid=536693230&cancel=1 400 1 BadRequest .NET+v4.5+Classic
2013-06-25 17:16:00 24.134.210.170 53157 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:16:47 24.134.210.170 53161 10.10.10.100 80 HTTP/1.1 POST /DownloadManager/DMUpload.aspx?folderId=22767&guid=536693230&cancel=1 400 1 Connection_Dropped .NET+v4.5+Classic
2013-06-25 17:24:00 24.134.210.170 53160 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:24:05 24.134.210.170 53176 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:27:16 ::1%0 49251 ::1%0 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:27:31 24.134.210.170 53274 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:29:55 24.134.210.170 53291 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:29:55 24.134.210.170 53290 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:29:55 24.134.210.170 53292 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:32:17 24.134.210.170 53319 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:32:52 24.134.210.170 53293 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
2013-06-25 17:32:52 24.134.210.170 53288 10.10.10.100 80 - - - - - Timer_ConnectionIdle -
我真的很感谢一些帮助,因为我真的不明白为什么会这样。真的很奇怪,我必须在服务器中直接启动应用程序,然后才能在其他电脑上使用它......
...编辑...
好的,这是应用程序中的 web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<section name="UploadModuleManagement" type="DimpleSoftwares.KFileUploadPlus.UploadModule,DimpleSoftwares.KFileUploadPlus" />
</configSections>
<UploadModuleManagement bufferSize="2000" />
<appSettings>
<add key="TempDir" value="./uploads" />
</appSettings>
<system.web>
<pages enableEventValidation="false" validateRequest="false" />
<httpHandlers>
<add verb="GET" path="FtbWebResource.axd" type="FreeTextBoxControls.AssemblyResourceHandler, FreeTextBox" />
</httpHandlers>
<httpModules>
<add name="UploadModule" type="DimpleSoftwares.KFileUploadPlus.UploadModule,DimpleSoftwares.KFileUploadPlus" />
</httpModules>
<compilation defaultLanguage="c#" debug="true" />
<customErrors mode="off" />
<authentication mode="Forms">
<forms name="DMAuthCookie" loginUrl="DMLogin.aspx" protection="All" timeout="240" slidingExpiration="true" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="240" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
<httpRuntime maxRequestLength="1048576" executionTimeout="14400" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
这是上传文件:
<%@ Page language="c#" Codebehind="DMUpload.aspx.cs" AutoEventWireup="false" Inherits="DownloadManager.DMUpload" EnableSessionState="ReadOnly"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>DMUpload</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<LINK href="StyleSheet.css" type="text/css" rel="stylesheet">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" onSubmit="uploadpop(this);" method="post" encType="multipart/form-data" runat="server">
<TABLE class="navigation" id="tbNavigation" cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD align="right">
<asp:panel id="Panel4" runat="server" CssClass="panelButtons" Width="800px">
<asp:button id=btSave tabIndex=3 runat="server" CssClass="butt" Text="Save"></asp:button>
<asp:button id=btBack tabIndex=3 runat="server" CssClass="butt" Text="back"></asp:button>
<asp:button id=btLogout tabIndex=3 runat="server" CssClass="butt" Text="Logout"></asp:button>
</asp:panel>
</TD>
</TR>
<tr>
<TD align="left">
<asp:panel id="Panel1" runat="server" CssClass="panelBreadcrumb"></asp:panel>
<asp:label id="lbBreadCrumb" runat="server" Font-Bold="True"></asp:label>
</TD>
</tr>
</TABLE>
<asp:label id="lbWarten" style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 248px" runat="server" Height="40px" ForeColor="Red" Font-Size="Medium" Width="536px">please wait...</asp:label>
<asp:panel id="panelUpload" style="Z-INDEX: 104; LEFT: 24px; POSITION: absolute; TOP: 96px" runat="server" Height="104px" Width="528px">
<asp:label id=Label1 runat="server" Width="304px">File:</asp:label>
<INPUT id=uploadFile1 style="WIDTH: 536px; HEIGHT: 22px" type=file size=70 runat="server">
<INPUT id=uploadFile2 style="WIDTH: 536px; HEIGHT: 22px" type=file size=70 runat="server">
<INPUT id=uploadFile3 style="WIDTH: 536px; HEIGHT: 22px" type=file size=70 runat="server">
<INPUT id=uploadFile4 style="WIDTH: 536px; HEIGHT: 22px" type=file size=70 runat="server">
<INPUT id=uploadFile5 style="WIDTH: 536px; HEIGHT: 22px" type=file size=70 runat="server">
</asp:panel>
</form>
<script language="javascript">
document.getElementById("lbWarten").style.visibility = "hidden";
function uploadpop(inForm)
{
document.getElementById("lbWarten").style.visibility = "visible";
if(inForm.uploadFile1 != null)
{
if( inForm.uploadFile1.value !=""
|| inForm.uploadFile2.value !=""
|| inForm.uploadFile3.value !=""
|| inForm.uploadFile4.value !=""
|| inForm.uploadFile5.value !="")
{
strUniqueID = Math.floor(Math.random() * 1000000) * ((new Date()).getTime() % 1000);
thePos = inForm.action.indexOf("?");
/*
if (thePos >= 0)
inForm.action = inForm.action.substring(0, thePos);
inForm.action += "?guid=" + strUniqueID + "&cancel=1";
*/
if (thePos >= 0)
inForm.action += "&guid=" + strUniqueID + "&cancel=1";
else
inForm.action += "?guid=" + strUniqueID + "&cancel=1";
window.open("DMProgressBar.aspx?guid=" + strUniqueID,"","toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=0,height=275,width=600,top=70,left=100");
}
}
inForm.submit();
return true;
}
function ClearInput()
{
node = document.getElementById("panelUpload");
if(node != null)
{
// node.removeNode(true);
node.parentNode.removeChild(node);
}
return true;
}
</script>
</body>
</HTML>