Beispiel #1
0
        public void ProcessRequest(HttpContext context)
        {
            var id = DownloadHelper.GetId(context);

            if (id == null)
            {
                Respond.BadRequest(context, "The 'id' parameter is missing or incorrectly formatted.");
                return;
            }

            var sw = Stopwatch.StartNew();

            new DownloadHelper().HandleDownload(context, id, null);
            _performanceLogger.Write(sw, "Downloaded file (DocumentVersionID = " + id + ") Executed.");
        }
Beispiel #2
0
        public void ProcessRequest(HttpContext context)
        {
            var id = DownloadHelper.GetId(context);

            if (id == null)
            {
                Respond.BadRequest(context, "The 'id' parameter is missing or incorrectly formatted.");
                return;
            }

            var query = HttpUtility.ParseQueryString(context.Request.Url.Query);

            if (!query.AllKeys.Any(name => name.ToLower() == "filename"))
            {
                Respond.BadRequest(context, "Fetching file preview requires filename as query parameter.");
                return;
            }

            var sw = Stopwatch.StartNew();

            new DownloadHelper().HandleDownload(context, null, id);
            _performanceLogger.Write(sw, "Downloaded file (LightDMS.FileContent.ID = " + id + ") Executed.");
        }
Beispiel #3
0
        public async Task ProcessRequest(HttpContext context)
        {
            var id = DownloadHelper.GetId(context);

            if (id == null)
            {
                await _respond.BadRequest(context, "The 'id' parameter is missing or incorrectly formatted.");

                return;
            }

            if (!context.Request.Query.Keys.Any(name => name.ToLower() == "filename"))
            {
                await _respond.BadRequest(context, "Fetching file preview requires filename as query parameter.");

                return;
            }

            var sw = Stopwatch.StartNew();
            await _downloadHelper.HandleDownload(context, null, id);

            _performanceLogger.Write(sw, "Downloaded file (LightDMS.FileContent.ID = " + id + ") Executed.");
        }