Welcome to Mediachase Community Sign in | Join | Help    
in Search   

McHtmlInputFile.PostedFile returning null

Last post Mon, Mar 01 2010, 9:29 AM by truthbrother. 7 replies.
Sort Posts: Previous Next
  •  Mon, Mar 17 2008, 6:56 PM 7953

    McHtmlInputFile.PostedFile returning null

    Hi

    For some reason McHtmlInputFile.PostedFile is always returning null, even though I'm selecting a file from the browser window.

    I am using Version 1.6 of your upload control, the upload control works within another page but for some reason "McHtmlInputFile.PostedFile" is always returning null even after I select a file

     

    My .aspx looks like this:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="zzz-test04.aspx.cs" Inherits="zzz_test04" %>

    <%@ Register assembly="Mediachase.FileUploader" namespace="Mediachase.FileUploader.Web.UI" tagprefix="mc" %>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

    <title>Untitled Page</title>

    </head>

    <body>

    <form id="form1" runat="server">

    <p>

    <mc:McHtmlInputFile runat="server" MaxLength="50" Size="30" Width="300px"

    ID="filUploadProfilePic">

    </mc:McHtmlInputFile>

    <br />

    <asp:Button runat="server" Text="Upload Selected Picture to our Server" CssClass="Verdana12ptBlk" Width="284px" ID="btnfileuploadProfilePic" EnableViewState="False" OnClick="btnfileuploadProfilePic_Click">

    </asp:Button>

    </p>

    <div>

    </div>

    </form>

    </body>

    </html>

     

    AND my .cs looks like this:

    using System;

    using System.Collections;

    using System.Configuration;

    using System.Data;

    using System.Linq;

    using System.Web;

    using System.Web.Security;

    using System.Web.UI;

    using System.Web.UI.HtmlControls;

    using System.Web.UI.WebControls;

    using System.Web.UI.WebControls.WebParts;

    using System.Xml.Linq;

    public partial class zzz_test04 : System.Web.UI.Page

    {

    protected void Page_Load(object sender, EventArgs e)

    {

    }

    protected void btnfileuploadProfilePic_Click(object sender, EventArgs e)

    {

    string cFileNameTemp = filUploadProfilePic.PostedFile.FileName; // PostedFile is always null

    string cFileExt = filUploadProfilePic.PostedFile.FileName.Substring(filUploadProfilePic.PostedFile.FileName.LastIndexOf(".") + 1);

    }

    }

    thanks,

  •  Tue, Mar 18 2008, 3:38 AM 7954 in reply to 7953

    Re: McHtmlInputFile.PostedFile returning null

    Hi

    To upload file, the Enctype property of an HtmlForm must be set to "multipart/form-data"

    Just  modify

    <form id="form1" runat="server">


    To

    <form id="form1" runat="server" enctype="multipart/form-data">

    Latest Mediachase FileUploader.Net version is 2.0.

    http://www.mediachase.com/FileUploader2/documentation/default.html


  •  Tue, Mar 18 2008, 6:56 AM 7955 in reply to 7954

    Re: McHtmlInputFile.PostedFile returning null

    Hi,

     

    thanks that worked, I have a nother question? I am using your FileUploader.net 1.6 control from withi a wizard control that is contained within an Ajax Update panel, But when I put it into an update panel the PostedFile retuen null, if I have it operating outside of the update panel then it works.

     

    Do you have any suggestions?

    thanks in advance.

     

  •  Wed, Mar 19 2008, 12:30 AM 7958 in reply to 7955

    Re: McHtmlInputFile.PostedFile returning null

  •  Sat, Mar 22 2008, 3:00 PM 7982 in reply to 7958

    Re: McHtmlInputFile.PostedFile returning null

    Hello,

    Thank you, I am now forcing a full postback on my upload picture button.  but sometimes I am getting the following error.  below is the stack,  do you have any ideas?

    thanks in advance.

     

    [Exception: Reqest was aborted]
       Mediachase.FileUploader.McHttpModule.694a7e1d01f817ae(Object 337e217cb3ba0627, EventArgs fbf34718e704c6bc) +2896
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

  •  Mon, Mar 24 2008, 3:16 AM 7984 in reply to 7982

    Re: McHtmlInputFile.PostedFile returning null

    Connection between client and server is closed.

    You can reconstruct error if press stop "internet browser" button while file is uploading.

    http://www.mediachase.com/Community/forums/thread/6507.aspx


  •  Fri, Feb 26 2010, 12:17 AM 11249 in reply to 7984

    Re: McHtmlInputFile.PostedFile returning null

    intersting samples

    viagra pharmacy
  •  Mon, Mar 01 2010, 9:29 AM 11251 in reply to 11249

    Re: McHtmlInputFile.PostedFile returning null

    spam
View as RSS news feed in XML
Site Terms | Privacy Policy | About Us | Contact Us
Running on Mediachase eCommerce Framework 4.0.
  Copyright © Mediachase, LTD. 1997-2006. All Rights Reserved

E-commerce, HelpDesk, Service Desk & Project Management Software, alternatives to Microsoft Project Server & Sharepoint Collaboration Server
project management software | microsoft project server | sharepoint collaboration server | issues management, helpdesk & service desk
Powered by Community Server, by Telligent Systems