Reputation: 1144
When I try to upload files using HTTP post with header Content-Type: multipart/form-data; boundary=-----NPRequestBoundary-----
everything works as expected but trying to use Content-Type: multipart/form-data; boundary=-----NPRequestBoundary-----; charset=UTF-8
cause completely blank $_FILES array.
Is it a problem with PHP or web server? As I know this form of Content-Type
is valid.
Upvotes: 3
Views: 2382
Reputation: 1144
I've found dirty workaround for this problem. For me it's ofc temporary bcs it doesn't work under litespeed (I used reverse proxy to apache to avoid this problem).
<Location "/upload.php">
RequestHeader set Content-Type "multipart/form-data; boundary=-----NPRequestBoundary-----"
</Location>
It will force webserver to replace content-type header. For now I'm sure - this is a PHP bug (someone assumed that charset will occur before boundary=
)
Upvotes: 0
Reputation: 160883
Because the Content-Type
is multipart/form-data
, this means it is built up from parts, and every part can have its own Content-Type
. The charset parameter is only used with text/plain
content-type. So it is meanless with a multipart/form-data
content-type.
Upvotes: 1