Losing Session variables with enctype="multipart/form-data"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FrankieBakerJr
    New Member
    • Feb 2007
    • 6

    Losing Session variables with enctype="multipart/form-data"

    Hello
    I'm using ASP.NET 2003 on Windows XP SP2. I'm providing a web form that allows users to upload a document (xls, images, doc, pdf, etc) to the server. This part works fine, but after the form posts to the server, all of my session variables are cleared out. The Session.Session ID is not affected, but the rest are blank. How do i keep these values populated while using this upload method?

    [HTML]
    <form name="form1" runat="server" enctype="multip art/form-data" ID="Form1">
    .
    .
    </form>
    [/HTML]

    I write the session variables to the screen when it does it's initial load (and the session variables are correct), and after the form is submitted (this is when i lose my values).
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Originally posted by FrankieBakerJr
    Hello
    I'm using ASP.NET 2003 on Windows XP SP2. I'm providing a web form that allows users to upload a document (xls, images, doc, pdf, etc) to the server. This part works fine, but after the form posts to the server, all of my session variables are cleared out. The Session.Session ID is not affected, but the rest are blank. How do i keep these values populated while using this upload method?

    [HTML]
    <form name="form1" runat="server" enctype="multip art/form-data" ID="Form1">
    .
    .
    </form>
    [/HTML]

    I write the session variables to the screen when it does it's initial load (and the session variables are correct), and after the form is submitted (this is when i lose my values).
    and if you change the enctype you lose the file upload but keep the session variables? Gee, I don't know what to tell you. Would it be convenient to switch to cookies?

    I'll post a link from the .NET forum in case they have a better idea.

    Jared

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Originally posted by FrankieBakerJr
      Hello
      I'm using ASP.NET 2003 on Windows XP SP2. I'm providing a web form that allows users to upload a document (xls, images, doc, pdf, etc) to the server. This part works fine, but after the form posts to the server, all of my session variables are cleared out. The Session.Session ID is not affected, but the rest are blank. How do i keep these values populated while using this upload method?

      [HTML]
      <form name="form1" runat="server" enctype="multip art/form-data" ID="Form1">
      .
      .
      </form>
      [/HTML]

      I write the session variables to the screen when it does it's initial load (and the session variables are correct), and after the form is submitted (this is when i lose my values).
      What type of Session are you using?
      If you are saving the file into Session, and you are using InProc, this could possibly increase the size aspnet_wp.exe (where your session objects are stored) to the point where the garbage collector recycles it.

      Comment

      Working...