This is a common problem for fileupload,
In IE this contol returns whole path of the file, while in Mozzila it takes only file name.
For example,
if you choose C:\test.txt in this control, it returns C:\test.txt in IE and test.txt in mozzila
try following code,
<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">
<title>Untitled Page</title>
<script type="text/C#" runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Request.Form["fileUpload"]);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="file" id="fileUpload" name="fileUpload" />
<asp:Button ID="chk" runat="server" Text="PostBack" />
</form>
</body>
</html>
Go Back in From
Back
In IE this contol returns whole path of the file, while in Mozzila it takes only file name.
For example,
if you choose C:\test.txt in this control, it returns C:\test.txt in IE and test.txt in mozzila
try following code,
<html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">
<title>Untitled Page</title>
<script type="text/C#" runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(Request.Form["fileUpload"]);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<input type="file" id="fileUpload" name="fileUpload" />
<asp:Button ID="chk" runat="server" Text="PostBack" />
</form>
</body>
</html>
Go Back in From
Back
No comments:
Post a Comment