Get rid of system web in netcore and netstandard libraries

This commit is contained in:
Bjarke Berg
2020-08-05 08:44:22 +02:00
parent 05e7d64a08
commit 3ea7945f24
16 changed files with 44 additions and 121 deletions

View File

@@ -4,7 +4,6 @@ using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Net.Http.Headers;
using Semver;
@@ -113,16 +112,15 @@ namespace Umbraco.Web.BackOffice.Controllers
var cd = new System.Net.Mime.ContentDisposition
{
FileName = HttpUtility.UrlEncode(fileName, encoding),
FileName = WebUtility.UrlEncode(fileName),
Inline = false // false = prompt the user for downloading; true = browser to try to show the file inline
};
Response.Headers.Add("Content-Disposition", cd.ToString());
// Set custom header so umbRequestHelper.downloadFile can save the correct filename
Response.Headers.Add("x-filename", HttpUtility.UrlEncode(fileName, encoding));
Response.Headers.Add("x-filename", WebUtility.UrlEncode(fileName));
return new FileStreamResult(System.IO.File.OpenRead(fullPath), new MediaTypeHeaderValue("application/octet-stream")
{
Charset = encoding.WebName,
});
}