|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33359 file_get_contents('php://input') does not return POST data
Submitted: 2005-06-16 08:53 UTC Modified: 2005-06-16 13:12 UTC
From: lacak at users dot sourceforge dot net Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5CVS-2005-06-16 OS: Win98
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
34 - 9 = ?
Subscribe to this entry?

 [2005-06-16 08:53 UTC] lacak at users dot sourceforge dot net
file_get_contents('php://input') (and also file, fopen+fread) does not return POST data, when submited form with enctype="multipart/form-data".

When submited the same form without enctype specified (so default "application/x-www-form-urlencoded" is used) all works OK.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-16 10:50 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-06-16 11:08 UTC] lacak at users dot sourceforge dot net
No solution.

$_POST is OK (contains form elements), but 
file_get_contents('php://input') returns empty string.

 [2005-06-16 12:40 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

 [2005-06-16 12:42 UTC]
This is how it works. 
See this post for detailed description:
 [2005-06-16 13:12 UTC] lacak at users dot sourceforge dot net
1. add in documentation, that php://input does not return result if multipart form is posted
2. or fix it , so php://input will return data

second option is better :-)
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Nov 30 14:05:55 2022 UTC