Example #1
0
        public async Task <ActionResult> FileHandler()
        {
            FileUploadHandler handler = new FileUploadHandler(Request, this);

            handler.IncomingRequestStarted += handler_IncomingRequestStarted;

            handler.AuthorizeRequestStarted  += handler_AuthorizeRequestStarted;
            handler.AuthorizeRequestFinished += handler_AuthorizeRequestFinished;

            handler.GetFilesRequestStarted   += handler_GetFilesRequestStarted;
            handler.GetFilesRequestFinished  += handler_GetFilesRequestFinished;
            handler.GetFilesRequestException += handler_GetFilesRequestException;

            handler.StoreFileRequestStartedAsync += handler_StoreFileRequestStartedAsync; // async event handler
            handler.StoreFileRequestFinished     += handler_StoreFileRequestFinished;
            handler.StoreFileRequestException    += handler_StoreFileRequestException;

            handler.DeleteFilesRequestStarted       += handler_DeleteFilesRequestStarted;
            handler.DeleteFilesRequestFinishedAsync += handler_DeleteFilesRequestFinishedAsync; // async event handler
            handler.DeleteFilesRequestException     += handler_DeleteFilesRequestException;

            handler.OutgoingResponseCreated += handler_OutgoingResponseCreated;

            handler.ProcessPipelineExceptionOccured += handler_ProcessPipelineExceptionOccured;


            ActionResult result = await handler.HandleRequestAsync();

            return(result);
        }
        public async Task<ActionResult> FileHandler()
        {
            FileUploadHandler handler = new FileUploadHandler(Request, this);
            handler.IncomingRequestStarted += handler_IncomingRequestStarted;

            handler.AuthorizeRequestStarted += handler_AuthorizeRequestStarted;
            handler.AuthorizeRequestFinished += handler_AuthorizeRequestFinished;

            handler.GetFilesRequestStarted += handler_GetFilesRequestStarted;
            handler.GetFilesRequestFinished += handler_GetFilesRequestFinished;
            handler.GetFilesRequestException += handler_GetFilesRequestException;

           handler.StoreFileRequestStartedAsync += handler_StoreFileRequestStartedAsync; // async event handler 
            handler.StoreFileRequestFinished += handler_StoreFileRequestFinished;
            handler.StoreFileRequestException += handler_StoreFileRequestException;

            handler.DeleteFilesRequestStarted += handler_DeleteFilesRequestStarted;
            handler.DeleteFilesRequestFinishedAsync += handler_DeleteFilesRequestFinishedAsync; // async event handler 
            handler.DeleteFilesRequestException += handler_DeleteFilesRequestException;

            handler.OutgoingResponseCreated += handler_OutgoingResponseCreated;

            handler.ProcessPipelineExceptionOccured += handler_ProcessPipelineExceptionOccured;


            ActionResult result = await handler.HandleRequestAsync();
            return result;
        }
        public async Task<ActionResult> FileHandler()
        {
            FileUploadHandler handler = new FileUploadHandler(Request, this);
            handler.IncomingRequestStarted += handler_IncomingRequestStarted;

            ActionResult result = await handler.HandleRequestAsync();
            return result;
        }
Example #4
0
        public async Task <ActionResult> FileHandler()
        {
            FileUploadHandler handler = new FileUploadHandler(Request, this);

            handler.IncomingRequestStarted += handler_IncomingRequestStarted;

            ActionResult result = await handler.HandleRequestAsync();

            return(result);
        }
        public async Task<ActionResult> FileHandler()
        {
            Debug.WriteLine("HAF HAF HAF");
            FileUploadHandler handler = new FileUploadHandler(Request, this);
            handler.StoreFileRequestFinished += handler_StoreFileRequestFinished;
            handler.IncomingRequestStarted += handler_IncomingRequestStarted;

            ActionResult result = await handler.HandleRequestAsync();  
            return result;
        }
        public async Task<ActionResult> FileHandler()
        {
            FileUploadHandler handler = new FileUploadHandler(Request, this);
            handler.FileUploadedStarted += FileUploadedStarted;
            handler.FileUploadedFinished += handler_FileUploadedFinished;
            handler.FileUploadException +=handler_FileUploadException;
            ActionResult result = await handler.HandleRequestAsync();

            return result;
        }
        private async Task<JQueryFileUpload> HandleRequest()
        {
            var request = new HttpRequestWrapper(HttpContext.Current.Request);
            FileUploadHandler handler = new FileUploadHandler(request, null);       // Get an instance of the handler class
            handler.IncomingRequestStarted += handler_IncomingRequestStarted;       // Register event handler for demo purposes

            var task = handler.HandleRequestAsync();                                // Call the asyncronous handler method
            // Do other stuff here
            var jsonResult = (JsonResult)await task;                                // Awaits the result, but does not block the thread
            //var jsonResult = (JsonResult)await handler.HandleRequestAsync();      // Both methods above can be combined 

            return (JQueryFileUpload)jsonResult.Data;                               // JsonResult.Data is of type object and must be casted 
            // to your plugins handler class
        }
Example #8
0
        public async Task <ActionResult> FileHandler()
        {
            FileUploadHandler handler = new FileUploadHandler(Request, this);

            handler.StoreFileRequestStarted         += handler_StoreFileRequestStarted;
            handler.StoreFileRequestFinished        += handler_StoreFileRequestFinished;
            handler.StoreFileRequestException       += handler_StoreFileRequestException;
            handler.OutgoingResponseCreated         += handler_OutgoingResponseCreated;
            handler.ProcessPipelineExceptionOccured += handler_ProcessPipelineExceptionOccured;

            ActionResult result = await handler.HandleRequestAsync();

            return(result);
        }
        private async Task <JQueryFileUpload> HandleRequest()
        {
            var request = new HttpRequestWrapper(HttpContext.Current.Request);
            FileUploadHandler handler = new FileUploadHandler(request, null);       // Get an instance of the handler class

            handler.IncomingRequestStarted += handler_IncomingRequestStarted;       // Register event handler for demo purposes

            var task = handler.HandleRequestAsync();                                // Call the asyncronous handler method
            // Do other stuff here
            var jsonResult = (JsonResult)await task;                                // Awaits the result, but does not block the thread

            //var jsonResult = (JsonResult)await handler.HandleRequestAsync();      // Both methods above can be combined

            return((JQueryFileUpload)jsonResult.Data);                               // JsonResult.Data is of type object and must be casted
            // to your plugins handler class
        }