Exemple #1
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;
            }

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

            _performanceLogger.Write(sw, "Downloaded file (DocumentVersionID = " + id + ") Executed.");
        }
Exemple #2
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.");
        }