13

Closed

AsyncFileUpload only support InProc session mode

description

HI,
I just found that the control store the HttpPostedFile in the session but since the object is not serializable , it will throw an exception if the current session mode is Oout of process (like sqlserver or stateserver).

see this thread:
http://forums.asp.net/t/1478889.aspx
Closed May 19, 2010 at 6:09 PM by BorisMo
Closed Today at 10:08 AM by BorisMo
This has been fixed in release 40412, as part of the related workitem fix on WorkItemId 24834.

The issue was that the “control stores the HttpPostedFile in the session but since the object is not serializable , it will throw an exception if the current session mode is out of process“.
The fix is that by default we no longer store the file in the session. This is controlled by a new PersistFile property which is false by default, so in the default scenario, (i.e. when leaving the PersistFile property set to false) changing SessionState to not be inProc will no longer cause an exception.

Note that if you do need to persist the file, we still don't support persisting using out-of-proc session state.

comments

schalkvanwyk wrote Oct 27, 2009 at 10:32 AM

Same problem here. It's unfortunate the guys have not catered/tested for this scenario...
Will have to use a alternative method, maybe get some hints from http://mattberseth.com/blog/2008/07/aspnet_file_upload_with_realti_1.html

fotoguy wrote Jan 4, 2010 at 11:45 PM

Glad someone found this before I went to far trying to use this control. Our production environment uses out of process.

obout wrote Feb 24, 2010 at 5:11 AM

This bug is fixed with patch #5356.
See http://ajax.codeplex.com/SourceControl/PatchList.aspx

BorisMo wrote Apr 16, 2010 at 12:46 AM

This has been fixed in release 40412, as part of the related workitem fix http://ajaxcontroltoolkit.codeplex.com/WorkItem/View.aspx?WorkItemId=24834.

PersistFile is false by default, so in the default scenario, changing SessionState to not be inProc will no longer cause an exception.

BorisMo wrote Apr 16, 2010 at 12:46 AM

Fixed in release 40412

** Closed by BorisMo 04/15/2010 4:46PM

eddiejaques wrote May 18, 2010 at 5:27 AM

Mind you, i am extremely furious at writing this , what doe sthis code mean in 40412
        if ((currentContext = GetCurrentContext()) != null)
        {
            var mode = currentContext.Session.Mode;
            if (mode != SessionStateMode.InProc) {

if NET4

                throw new InvalidOperationException(Resources_NET4.SessionStateOutOfProcessNotSupported);

else

                throw new InvalidOperationException(Resources.SessionStateOutOfProcessNotSupported);

endif

            }
            currentContext.Session.Add((GetFullID(controlId), fileUpload));
        }

BorisMo wrote May 19, 2010 at 6:04 PM

Modifying comment for closing this issue

BorisMo wrote May 19, 2010 at 6:08 PM

This has been fixed in release 40412, as part of the related workitem fix on WorkItemId 24834.

The issue was that the “control stores the HttpPostedFile in the session but since the object is not serializable , it will throw an exception if the current session mode is out of process“.
The fix is that by default we no longer store the file in the session. This is controlled by a new PersistFile property which is false by default, so in the default scenario, (i.e. when leaving the PersistFile property set to false) changing SessionState to not be inProc will no longer cause an exception.

Note that if you do need to persist the file, we still don't support persisting using out of prox session state.

** Closed by BorisMo 05/19/2010 10:08AM

BorisMo wrote May 19, 2010 at 6:08 PM