Asp.net core mvc .Net Core中的System.ServiceModel.Web替代方案
我正在将.NETFramework服务迁移到.NETCore2.2。旧版本中有一个NuGetAsp.net core mvc .Net Core中的System.ServiceModel.Web替代方案,asp.net-core-mvc,Asp.net Core Mvc,我正在将.NETFramework服务迁移到.NETCore2.2。旧版本中有一个NuGetSystem.ServiceModel.Web,它在.NETCore中似乎不起作用。我需要一个WebOperationContext的替代方案 代码是: Stream stream = UploadDownloadServiceHelper.DownloadFolder(folderPath); string headerInfo = "attachment; filename= Attach
System.ServiceModel.Web
,它在.NETCore中似乎不起作用。我需要一个WebOperationContext
的替代方案
代码是:
Stream stream = UploadDownloadServiceHelper.DownloadFolder(folderPath);
string headerInfo = "attachment; filename= Attachments.zip";
WebOperationContext.Current.OutgoingResponse.Headers["Content-Disposition"] = headerInfo;
WebOperationContext.Current.OutgoingResponse.ContentType = "application/zip";
你可以参考这个。