I have an IP-camera that on trigger uploads JPG picture to my apache-php web server.
camera sends POST request with multipart data separated with boundaries, and it is ok in most cases.
but sometimes (every ~5th picture) camera sends wrong content-length (very big number, 139TB). that is some bug in camera software. $_REQUEST and $_FILES arrays are empty when this problem occurs.
except wrong content-length, everything else is fine inside request, i listen-ed it with NETCAT and parsed picture well, it was ok (14KB only)
so if i can just tell php (php.ini or something) to ignore content-length and read post vars by boundary, everything will be fine.
is there such switch for php?
update:
after analyse, it seems that in case of this camera,
wrongContentLength is always == correctLength + 139736760975360
== correctLength + 0x00007f1700000000
which is maybe caused by some 32bit - 64bit mixup.
But only way to ignore the problem is manualy parsing php://input
which is readable when problem ocurres ...reading boundary from getallheaders(), and parsing file-data between two of them.