How to keep the value of an INPUT TYPE="FILE" after postback ?


  • Hi Guys,

    I am having a simple, I suppose, problem with <input type="file"> control.

    I need to keep its value during some post backs of my page, but I can't. I loose it's value after all post backs.

    Any one knows how to keep it ????


    Wednesday, February 15, 2006 1:11 PM

All replies

  • Hey,

    If it has runat="server", it should retain it...  Did you turn off viewstate?  Could you post the definition or code?


    Wednesday, February 15, 2006 1:26 PM
  • Hi Brian,

    The code is here:

    HTML File:

    "<input class="fieldForm" id="txtFileName" type="file" size="74" runat="server">"

    I am using runat=server, but the value do not stay there after postbacks.

    The problem is simple. I have a form with a great number of controls, and some of them has autopostback. After some postback, the input file control looses its value.

    I need to know how to keep this value there.


    Wednesday, February 15, 2006 1:31 PM
  • Hey,

    I read more about FileInput, and found some things that aren't favorable towards this situation, which you can find here:  http://dotnetillustrated.blogspot.com/2006/02/htmlinputfile-and-fileupload.html


    Thursday, February 16, 2006 1:24 PM