public FileUploadResult ProcessUpload(HttpContext context)
        {
            var result = new ContactsUploaderResult();

            try
            {
                SecurityContext.CheckPermissions(Constants.Action_AddRemoveUser);

                if (context.Request.Files.Count == 0)
                {
                    result.Success = false;
                    result.Message = Resource.ErrorEmptyUploadFileSelected;
                    return(result);
                }

                var file = context.Request.Files[0];

                const int maxFileSize = 512000;
                if (file.ContentLength > maxFileSize)
                {
                    result.Success = false;
                    result.Message = String.Format(Resource.ImportContactsFromFileErrorTooLarge, (maxFileSize / 1024));
                    return(result);
                }

                var ext = FileUtility.GetFileExtension(file.FileName);
                if (ext != ".csv")
                {
                    result.Success = false;
                    result.Message = Resource.ErrorEmptyUploadFileSelected;
                    return(result);
                }

                var param = new FileParameters
                {
                    Encode     = Convert.ToInt32(context.Request["enc"]),
                    Separator  = Convert.ToInt32(context.Request["sep"]),
                    Delimiter  = Convert.ToInt32(context.Request["del"]),
                    Position   = Convert.ToInt32(context.Request["pos"]),
                    IsRaw      = Convert.ToBoolean(context.Request["raw"]),
                    UserHeader = context.Request["head"]
                };

                IUserImporter importer = new TextFileUserImporter(file.InputStream, param);

                var users = (param.IsRaw)
                                ? (IEnumerable)importer.GetRawUsers()
                                : importer.GetDiscoveredUsers();

                result.Message = JsonConvert.SerializeObject(users);
                result.Columns = JsonConvert.SerializeObject(ContactInfo.GetColumns());
                result.Success = true;
            }
            catch (Exception ex)
            {
                result.Success = false;
                result.Message = ex.Message.HtmlEncode();
            }

            return(result);
        }