下載使用,直到我升級角到最新的工作在我的應用精細文件斑點法損壞。即使是現在,該文件正在下載,但問題是,它正在被損壞。上傳文件工作正常,如果我們簽入文件服務器,文件將完好無損。但下載後,我收到損壞的文件。下載文件得到使用angularJS
HTML:
<td data-title="''">
<a tooltip="Download CV" ng-hide="!talent.resumePath" tooltip-trigger tooltip-animation="false" tooltip-placement="bottom" ng-click="downloadResume(talent.id)" data-placement="top" data-toggle="tooltip" data-original-title="resume">
<img src="../../img/DownloadIcon.png" /></a>
</td>
控制器:
downloadResume: function(employeeId) {
return apiServices.getFileFromTalentPool('/talentpool/resume?id=' + employeeId)
},
其中,getFileFromTalentPool是:https://hastebin.com/yivaterozi.js
端點:
public FileResult GetResume(int id) {
var result = _services.GetResume(id);
if (result != null) {
HttpContext.Response.ContentType = result.ContentType;
HttpContext.Response.Headers["Access-Control-Expose-Headers"] = "FileName";
HttpContext.Response.Headers["FileName"] = result.FileDownloadName;
}
return result;
}
通常我道禁止Doc文件。我試着用記事本文件來查看它是否相同。奇怪的是,我注意到,我能打開記事本文件,但其內容操縱像[object Object]
。但對於DOC文件,它只是顯示http://oi68.tinypic.com/2i11m9y.jpg
我怎樣才能解決這個問題?
非常感謝。這就像一個魅力! :) – Phoenix