Ejemplo n.º 1
0
        public object Any(GetFile request)
        {
            var file = VirtualFileSources.GetFile(request.Path);
            if (file == null)
                throw HttpError.NotFound("File '{0}' does not exist".Fmt(request.Path));

            return new HttpResult(file) {
                ContentType = MimeTypes.GetMimeType(file.Extension)
            };
        }
Ejemplo n.º 2
0
        public object Any(GetFile request)
        {
            var file = VirtualFileSources.GetFile(request.Path);

            if (file == null)
            {
                throw HttpError.NotFound("File '{0}' does not exist".Fmt(request.Path));
            }

            return(new HttpResult(file)
            {
                ContentType = MimeTypes.GetMimeType(file.Extension)
            });
        }