开发者

How to use Content-Type: Multipart/Related

I want to send a binary file to the user and have some HTML display on the browser. I'm using a CGI-BIN script with apache2. I found this example on page 4. The link also shows details about the multipart/related content-type. Here's what I tried so far:

Content-Type: Multipart/Related; boundary="boundary-content"; start=""; type=\"text/plain\""

--boundary-content
Content-Disposition: inline
Content Type:text/plain
Content-ID: <abc>

hi
开发者_JS百科
--boundary-content
Content Type:application/octet-stream
Content-Disposition: attachment;filename=myfile
Content-ID: 2

...

--boundary-content

The whole thing after the first Content-Type line shows up as a single plaintext attachment. How can I make the browser say hi and prompt to download myfile with contents of ...?


i do not think browsers understand multipart MIME responses

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜