来自 Firebug :
如果我想使用 php-curl 模拟此请求,我是否需要担心上传流中的请求 header ?它到底是什么?
最佳答案
当您上传文件时,在 HTTP 请求期间,您会看到标准的 HTTP 请求 header ,然后您会得到如下内容:
-------------------------------18788734234
Content-Disposition: form-data; name="nonfile_field"
{input field here}
-------------------------------18788734234
Content-Disposition: form-data; name="myfile"; filename="somefile.gif"
Content-Type: image/gif
{uploaded file here}
-------------------------------18788734234--
Firebug 正在提取文件上传附带的这些额外请求 header ,并为您提供更多相关信息。如果您使用 php-curl 进行标准文件上传,curl 将执行所需操作以确保上传成功。
关于php - 什么是 "Request Headers From Upload Stream",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16548517/