0 GP
在Response Header中存取Content-Disposition
作者:窗台上的兔子│2020-02-06 15:30:04│巴幣:0│人氣:594
當Web API進行檔案下載時,若
Body為
Byte[],常常會在
Header中的
Content-Disposition夾帶
attachment; filename=file.txt記錄檔名等其他資訊。
但當讀取其Header的Content-Disposition內容卻傳回Null時,我們可以在Web API回傳的Header上添加Access-Control-Expose-Headers且值為Content-Disposition這樣就能存取檔名內容了。
參考資料
引用網址:https://home.gamer.com.tw/TrackBack.php?sn=4676129
All rights reserved. 版權所有,保留一切權利