public void ProcessRequest(HttpContext context)
        {
            // Get arguments passed via query string
            UploaderHelper args = new UploaderHelper(context);
            String appPath = context.Server.MapPath("~/");
            DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

            if (args.Canceled)
            {
                // Remove file from server if canceled
                args.CleanTempFile();
            }
            else
            {
                args.ProcessFile();
                if (args.Complete)
                {
                    if (args.IsMediaLibraryUpload)
                    {
                        HandleMediaLibraryUpload(args, context);
                    }
                    args.CleanTempFile();
                }
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                // Get arguments passed via query string
                UploaderHelper args    = new UploaderHelper(context);
                String         appPath = context.Server.MapPath("~/");
                DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

                if (args.Canceled)
                {
                    // Remove file from server if canceled
                    args.CleanTempFile();
                }
                else
                {
                    args.ProcessFile();
                    if (args.Complete)
                    {
                        if (args.IsForumAttachmentUpload)
                        {
                            HandleForumUpload(args, context);
                        }
                        args.CleanTempFile();
                    }
                }
            }
            catch (Exception ex)
            {
                // Send error message
                context.Response.Write(String.Format(@"0|{0}", HTMLHelper.EnsureLineEnding(ex.Message, " ")));
                context.Response.Flush();
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                // Get arguments passed via query string
                UploaderHelper args = new UploaderHelper(context);
                String appPath = context.Server.MapPath("~/");
                DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

                if (args.Canceled)
                {
                    // Remove file from server if canceled
                    args.CleanTempFile();
                }
                else
                {
                    args.ProcessFile();
                    if (args.Complete)
                    {
                        if (args.IsForumAttachmentUpload)
                        {
                            HandleForumUpload(args, context);
                        }
                        args.CleanTempFile();
                    }
                }
            }
            catch (Exception ex)
            {
                // Send error message
                context.Response.Write(String.Format(@"0|{0}", HTMLHelper.EnsureLineEnding(ex.Message, " ")));
                context.Response.Flush();
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            // Get arguments passed via query string
            UploaderHelper args    = new UploaderHelper(context);
            String         appPath = context.Server.MapPath("~/");

            DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

            if (args.Canceled)
            {
                // Remove file from server if canceled
                args.CleanTempFile();
            }
            else
            {
                args.ProcessFile();
                if (args.Complete)
                {
                    if (args.IsMediaLibraryUpload)
                    {
                        HandleMediaLibraryUpload(args, context);
                    }
                    args.CleanTempFile();
                }
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                // Get arguments passed via query string
                UploaderHelper args    = new UploaderHelper(context);
                String         appPath = context.Server.MapPath("~/");
                DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

                if (args.Canceled)
                {
                    // Remove file from server if canceled
                    args.CleanTempFile();
                }
                else
                {
                    args.ProcessFile();
                    if (args.Complete)
                    {
                        switch (args.SourceType)
                        {
                        case MediaSourceEnum.Attachment:
                        case MediaSourceEnum.DocumentAttachments:
                            HandleAttachmentUpload(args, context);
                            break;

                        case MediaSourceEnum.Content:
                            HandleContentUpload(args, context);
                            break;

                        case MediaSourceEnum.PhysicalFile:
                            HandlePhysicalFilesUpload(args, context);
                            break;

                        case MediaSourceEnum.MetaFile:
                            HandleMetafileUpload(args, context);
                            break;
                        }

                        args.CleanTempFile();
                    }
                }
            }
            catch (Exception ex)
            {
                // Send error message
                context.Response.Write(String.Format(@"0|{0}", HTMLHelper.EnsureLineEnding(ex.Message, " ")));
                context.Response.Flush();
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            // Get arguments passed via query string
            UploaderHelper args    = new UploaderHelper(context);
            String         appPath = context.Server.MapPath("~/");

            DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

            if (args.Canceled)
            {
                // Remove file from server if canceled
                args.CleanTempFile();
            }
            else
            {
                args.ProcessFile();
                if (args.Complete)
                {
                    switch (args.SourceType)
                    {
                    case MediaSourceEnum.Attachment:
                    case MediaSourceEnum.DocumentAttachments:
                        HandleAttachmentUpload(args, context);
                        break;

                    case MediaSourceEnum.Content:
                        HandleContentUpload(args, context);
                        break;

                    case MediaSourceEnum.PhysicalFile:
                        HandlePhysicalFilesUpload(args, context);
                        break;

                    case MediaSourceEnum.MetaFile:
                        HandleMetafileUpload(args, context);
                        break;
                    }

                    args.CleanTempFile();
                }
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                // Get arguments passed via query string
                UploaderHelper args = new UploaderHelper(context);
                String appPath = context.Server.MapPath("~/");
                DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

                if (args.Canceled)
                {
                    // Remove file from server if canceled
                    args.CleanTempFile();
                }
                else
                {
                    args.ProcessFile();
                    if (args.Complete)
                    {
                        switch (args.SourceType)
                        {
                            case MediaSourceEnum.Attachment:
                            case MediaSourceEnum.DocumentAttachments:
                                HandleAttachmentUpload(args, context);
                                break;

                            case MediaSourceEnum.Content:
                                HandleContentUpload(args, context);
                                break;

                            case MediaSourceEnum.PhysicalFile:
                                HandlePhysicalFilesUpload(args, context);
                                break;

                            case MediaSourceEnum.MetaFile:
                                HandleMetafileUpload(args, context);
                                break;
                        }

                        args.CleanTempFile();
                    }
                }
            }
            catch (Exception ex)
            {
                // Send error message
                context.Response.Write(String.Format(@"0|{0}", HTMLHelper.EnsureLineEnding(ex.Message, " ")));
                context.Response.Flush();
            }
        }
        public void ProcessRequest(HttpContext context)
        {
            // Get arguments passed via query string
            UploaderHelper args = new UploaderHelper(context);
            String appPath = context.Server.MapPath("~/");
            DirectoryHelper.EnsureDiskPath(args.FilePath, appPath);

            if (args.Canceled)
            {
                // Remove file from server if canceled
                args.CleanTempFile();
            }
            else
            {
                args.ProcessFile();
                if (args.Complete)
                {
                    switch (args.SourceType)
                    {
                        case MediaSourceEnum.Attachment:
                        case MediaSourceEnum.DocumentAttachments:
                            HandleAttachmentUpload(args, context);
                            break;

                        case MediaSourceEnum.Content:
                            HandleContentUpload(args, context);
                            break;

                        case MediaSourceEnum.PhysicalFile:
                            HandlePhysicalFilesUpload(args, context);
                            break;

                        case MediaSourceEnum.MetaFile:
                            HandleMetafileUpload(args, context);
                            break;
                    }

                    args.CleanTempFile();
                }
            }
        }