Sep 18, 2013, 12:27 PM
[CLOSED] FileUploadField PostedFile always null
Hey,
I know this is a much-discussed problem, but I haven't found a solution that works yet.
No matter which file I select, the FileUploadField1 is always empty in the handler.
I have a page set up as follows (basically an example I found in another thread):
I know this is a much-discussed problem, but I haven't found a solution that works yet.
No matter which file I select, the FileUploadField1 is always empty in the handler.
I have a page set up as follows (basically an example I found in another thread):
<%@ Page
Language="C#"
AutoEventWireup="True"
CodeBehind="~/Views/Sales/PurchaseInvoiceImport.aspx.cs"
Inherits="eAccounts.Web.Views.Sales.PurchaseInvoiceImport"
MasterPageFile="~/Views/Shared/DesktopMasterPage.Master" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<script runat="server">
protected void FileUploadField_FileSelected(object sender, DirectEventArgs e)
{
this.FileUploadField1.PostedFile.SaveAs("C:\\Documents\\TESTFILE.txt");
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManagerPurchaseInvoiceImport" runat="server"/>
<ext:FileUploadField ID="FileUploadField1" runat="server" Width="300">
<DirectEvents>
<FileSelected OnEvent="FileUploadField_FileSelected" IsUpload="true" />
</DirectEvents>
</ext:FileUploadField>
</form>
</asp:Content>
Any help would be greatly appreciated.
Last edited by Daniil; Oct 04, 2013 at 5:39 AM.
Reason: [CLOSED]