public void OnActionExecuting(ActionExecutingContext context)
            {
                var request = context.HttpContext.Request;

                if (!request.HasFormContentType)
                {
                    return;
                }

                var numFiles = request.Form.Files.Count;

                if (numFiles <= 0)
                {
                    return;
                }

                long maxBytes = 1024 * _mediaSettings.MaxUploadFileSize;

                foreach (var file in request.Form.Files)
                {
                    if (file.Length > maxBytes)
                    {
                        throw _exceptionFactory.MaxFileSizeExceeded(file.FileName, file.Length, maxBytes);
                    }
                }
            }
            public void OnActionExecuting(ActionExecutingContext context)
            {
                var request  = context.HttpContext.Request;
                var numFiles = request.Form.Files.Count;

                if (numFiles <= 0)
                {
                    return;
                }

                long maxBytes = 1024 * _mediaSettings.MaxUploadFileSize;

                for (var i = 0; i < numFiles; ++i)
                {
                    var file = request.Form.Files[i];
                    if (file.Length > maxBytes)
                    {
                        throw _exceptionFactory.MaxFileSizeExceeded(file.FileName, file.Length, maxBytes);
                    }
                }
            }