I have a device that submits ~20,000 small 16-byte binary files (data from RFID tags) as multipart/form-data
to a URL of my choice.
------WebKitFormBoundaryP1dTbAtca8AXmaAM
Content-Disposition: form-data; name="400000001"; filename="400000001.bin"
Content-Type: application/vnd.ply-badge
⚉⟗⢑☭⥢↺⡠⥔
------WebKitFormBoundaryP1dTbAtca8AXmaAM
Content-Disposition: form-data; name="400000002"; filename="400000002.bin"
Content-Type: application/vnd.ply-badge
⨧ⶈⰡⰑ⸈ⱬ⋪⣫
I want to insert this data into a SQL database. Right now the back end for the rest of this application is PHP, so I would like to do this in PHP as well. Right now I am getting
PHP Warning: Maximum number of allowable file uploads has been exceeded in Unknown on line 0
I'm aware I can raise the limit in the php.ini file, and if I do it works, but it writes all 20,000 files to disk. Since this is less than 400K of actual data (maybe a few MB once you include metadata) I would like to just load it into memory and skip the filesystem all together. Does PHP have an option to load values like this into $_POST
rather than writing them to disk and using $_FILES
? If not, is there some other mechanism that will let me parse this data without writing everything to disk?
Unfortunately this is on a Windows server, so in-memory filesystems are... complicated.