I am trying to upload a file with App Inventor 2 to a server through PHP. I followed the Photo Booth Android app tutorial, however server-side, myPhoto.jpg contains the filename, not the picture's content (e.g. myPhoto.jpg contains something like "file:///storage/emulated/0/Pictures/app_inventor_1424997354199.jpg"). How can I fix it?
The code I use:
tempSaveFile.php :
<?php
$dataToWrite = $_REQUEST['fileName'];
$fileName = "myPhoto.jpg";
file_put_contents($fileName, $dataToWrite);
?>
I am aware of Taifun's tutorial but since in my php.ini always_populate_raw_post_data = On
I would prefer to avoid having to install anything.
Scott's tutorial seems to do something similar (with App Inventor 1):