Custom AsyncUploadHandler

2 posts, 0 answers
  1. Pete
    Pete avatar
    17 posts
    Member since:
    Sep 2010

    Posted 21 Sep 2010 Link to this post

    Hi,
    I'm using the AsyncUpload control in an MVC.NET project, and want to change the TempTargetFolder (dynamically) in the IAsyncUploadResult method. However, I don't have access to Session variables for the current context. (Either accessed via Session. or context parameter)
    Here's an example of my code:

    protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
    {
      // This will throw an exception even when I've set it in the controller
      configuration.TempTargetFolder = context.Session["MySessionVar"].ToString();
      return base.Process(file, context, configuration, fileName);
    }

    Any suggestions?
    Thanks!
    Pete
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 24 Sep 2010 Link to this post

    Hi Pete,

    The Session in MVC is obtained the same way as in ASP.NET. We are not sure what exactly is going wrong on your side. Please, open a support ticket and send us a sample runnable project that reproduces the fault so that we can take a look at it.

    Regards,
    Genady Sergeev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top