我有一個關於IIS和ASP.Net的問題。XML解析錯誤:找不到元素?
我遷移到一個新的服務器,我必須運行上傳/下載應用程序。這個應用程序在舊服務器上運行良好,現在我得到了一些解析錯誤,我不明白它在哪裏。 它工作時,我試圖donwload一些文件,我也有一個連接和登錄系統works.But如果我嘗試上傳一些文件,然後來這個解析錯誤。一開始我認爲它必須是一些權限問題,但是在我添加了一些用戶權限之後,這並沒有什麼意義。
XML解析錯誤:
no element found Location: http://www.mywebsite.com/DownloadManager/DMUpload.aspx?folderId=22767&guid=271334658&cancel=1 Line Number 1, Column 1:
這是我upload.aspx文件:
<%@ 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="Speichern"></asp:button>
<asp:button id=btBack tabIndex=3 runat="server" CssClass="butt" Text="Zurück"></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">bitte warten...</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">Dateiauswahl:</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>
我真的鴕鳥政策得到,爲什麼它doesn't工作。
aspx上傳必須將文件發送到一個名爲uploads的臨時文件夾中,文件上傳後必須發送到oder文件夾,這取決於用戶的權限。我注意到文件被上傳並保存在臨時文件夾中,但是它沒有任何事情發生,並且我像我說的那樣收回瞭解析錯誤。
我不知道可能是什麼問題,我真的需要一些幫助。
只是一件額外的事情,如果我嘗試運行本地主機下的應用程序,我什麼都不會只是網站的主頁。
嗯,我已經修復它。我認爲這是一個有約束力的問題,我只寫了一個本地主機IP地址,並開始像魅力一樣工作! – 2013-03-05 15:05:40
我正面臨類似的問題。什麼對你有用?你在地址欄中寫的IP地址而不是localhost是你的意思? – AkshayJ 2015-08-04 04:49:29