【发布时间】:2010-09-11 04:15:29
【问题描述】:
我想在PHP:接收以下HTTP请求
Content-type: multipart/form-data;boundary=main_boundary
--main_boundary
Content-type: text/xml
<?xml version='1.0'?>
<content>
Some content goes here
</content>
--main_boundary
Content-type: multipart/mixed;boundary=sub_boundary
--sub_boundary
Content-type: application/octet-stream
File A contents
--sub_boundary
Content-type: application/octet-stream
File B contents
--sub_boundary
--main_boundary--
(注意:我缩进了子部分只是为了让这篇文章更具可读性。)
我对 PHP 不是很流利,希望获得一些帮助/指针来弄清楚如何在 PHP 代码中接收这种多部分表单请求。我曾经写过一些代码,我收到一个标准的 HTML 表单,然后我可以通过使用它们的名称作为 $HTTP_GET_VARS 数组中的索引键来访问表单元素,但在这种情况下,没有表单元素名称,并且表单数据部分不是线性的(即子部分 = 多级数组)。
感谢您的帮助!
/罗伯特
【问题讨论】:
标签: php http mime multipart form-data