I receive the mail request on my api.php script. Content red using this code:
$ fp = fopen ('php: // stdin', 'r'); $ All = ""; While ($ line = fgets ($ fp, 4096)) {$ all = $ line; } Resonate all; looks like this:
------------ V2ymHFg03ehbqgZCaKO6jy Content-presentation: form-data; Name = "intro" o ------------ V2ymHFg03ehbqgZCaKO6jy Content-Vision: form-data; Name = "title" T ------------ V2ymHFg03ehbqgZCaKO6jy content- Disposition: form-data; Name = "apiKey" 98d32fdsa ------------ V2ymHFg03ehbqgZCaKO6jy Content-Vision: form-data; Name = "method" / media / add ------------ V2ymHFg03ehbqgZCaKO6jy content- Disposition: form-data; Name = "upload_field"; Filename = "original_filename.png" Content-Type: Image / PNG ------------ V2ymHFg03ehbqgZCaKO6jy-- As you can see I have named 4 parameter names Is known from, title, apiKey and method, and a file named original_filename.png with the size of 1460 bytes.
Unfortunately, my $ _POST array is empty, what is odd when orginal_filename.png is less than 1450 bytes, including $ _POST contains all the parameters, and stdin is empty.
I want to be able to read these areas like the normal engine PHP $$ _POST
P> As I've read in the manual, raw post data is not available with ntp = "multipart / form-data" but you
You can also try with $ fp = fopen (php): // stdin ',' rb '); Please pay attention to the " b " flag.
Also, make sure always_populate_post_data = on in your php.ini
Comments
Post a Comment