Session is cleared after upload

  •  09-10-2009, 4:14 AM

    Session is cleared after upload

    Hello,
     
    I'm using a basic Uploader within an asp:updatepanel
     
     
    <asp:UpdatePanel ID="TicketPanel" runat="server" UpdateMode="Conditional">
      <ContentTemplate>
        <CuteWebUI:Uploader runat="server"
                            ID="TicketAddAttachment"
                            InsertText="Add Attachment..."
                            ShowProgressInfo="false"
                            OnFileUploaded="Attachment_UploadComplete" >

              <ValidateOption MaxSizeKB="1024" AllowedFileExtensions="jpeg,jpg,gif,png,bmp,txt,doc,docx,pdf,xls,xlsx,rtf" />

        </CuteWebUI:Uploader>
      </ContentTemplate>
    </asp:UpdatePanel>

    It seems to work fine and I can manipulate the file in the Attachment_UploadComplete method and all looks good.  Within this method, I am using the OpenStream() to get a stream with which I am creating a copy of the uploaded file and a thumbnail Image when an image has been uploaded.

    However, I'm finding that once I'm done this is completed and I do something else, e.g. go to another page or click another unrelated button, my Session has been competely cleared out of data and is empty.  This is causing problems because I'm storing some unrelated data in the Session to store state about another part of the application.

    Any ideas why this may be happening?
     
    Thanks
     
    Paul
    Filed under:
View Complete Thread