3
我想向用戶發送一個二進制文件,並在瀏覽器上顯示HTML。我正在使用apache2的CGI-BIN腳本。我發現this example on page 4。該鏈接還顯示有關多部分/相關內容類型的詳細信息。這是我試過到目前爲止:第一Content-Type
線顯示爲一個單一的純文本附件如何使用Content-Type:Multipart/Related
Content-Type: Multipart/Related; boundary="boundary-content"; start=""; type=\"text/plain\"" --boundary-content Content-Disposition: inline Content Type:text/plain Content-ID: <abc> hi --boundary-content Content Type:application/octet-stream Content-Disposition: attachment;filename=myfile Content-ID: 2 ... --boundary-content
整個事情經過。如何讓瀏覽器說hi
並提示下載myfile
,內容爲...
?