php://input is a read-only stream that allows you to read raw data from the request body. In the case of POST requests, it is preferable to use php://input instead of $HTTP_RAW_POST_DATA as it does not depend on special php.ini directives. Moreover, for those cases where $HTTP_RAW_POST_DATA is not populated by default, it is a potentially less memory intensive alternative to activating always_populate_raw_post_data. php://input is not available with enctype="multipart/form-data".
Hi again,Do either of you know if you can detect the error 1104 when it pops up? I essentially have this script uploading the image every time the camera takes a picture. It works 75% of the time, but sometimes I get an error bubble that pops up for a few seconds then disappears it says, "error 1104" and then says it wasn't able to POST the file. I would like to be able to detect it so I can have the app try again. Any ideas?
-Zach
On Wednesday, February 6, 2013 11:42:55 AM UTC-6, Zach Soflin wrote:
GOT IT! wow that took way too long, but I found a post from Scott that said to try swapping out php://input with php://stdin. It worked! So anyone using host gator make sure to enable always_populate_raw_post_data by contacting customer service and begging and pleading (they are pretty good about it). Then using Scotts example but swap out php://input for php://stdin. Thanks for the direction you two.
-Zach
On Wednesday, February 6, 2013 11:06:19 AM UTC-6, Zach Soflin wrote:
Thanks for the quick reply Taifun,Hum... I contacted HostGator and got always_populate_raw_post_data enabled. Using phpinfo() i can see that it is enabled. I am still getting a blank file in my directory with no errors anywhere. I guess the only problem showing is when I hit the "Post" button on Scotts example, It gives me the error "1104 unable to Post file..." but if I push the button again the response reads "file transfer completed".and the blank file shows up on my web server. Any other ideas? This is stumping me.
-Zach
On Wednesday, February 6, 2013 9:50:46 AM UTC-6, Taifun wrotey to
<?PHP $data = file_get_contents('php://input'); echo $data; if (!(file_put_contents($_GET['fn'],$data) === FALSE)) echo "File xfer completed."; // file could be empty, though else echo "File xfer failed.";?>
always_populate_raw_post_data = On
---sfs
I am also getting the full file name saved with 0kb. Is this a permission issue?
How would I find out if my Android device is sending the full file rather than just the name?
I am also getting the full file name saved with 0kb. Is this a permission issue?in the php script try to replace php://input by php://stdin
Trying to push the limits of App Inventor!
Snippets and
Tutorials from
Pura Vida Apps by
Taifun.
--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Where do I put the .php file?