2010-08-16 91 views
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,內容爲...

回答

0

我不認爲瀏覽器能夠理解多部分MIME響應