0

Am testing my luck with the MIT App Inventor, and am trying to POST more than 1 image at a time to my PHP script to insert in a database. I have successfully POSTed 1 image, but can't seem to do more than just 1 with file_get_contents. I have tried

$remote_content = explode("\n", file_get_contents('php://stdin'));
file_put_contents($upload_dir . $filename, $remote_content[0]); //etc

but all of the images have 0KB. Have also tried looping (foreach), to the same lack of success.

Is there some alternative? Or should this be POSTed differently on the app's side? Right now, it's individually posted all at 1 time (so

if not is empty image1,
 postFile image1
if not is empty image2
 postFile image 2

etc.

Taifun
  • 6,165
  • 17
  • 60
  • 188
Hybride
  • 322
  • 4
  • 17
  • Are you really sending newline-separated binary data? (Not likely to work. Use a proper multipart POST payload.) – mario Jun 12 '15 at 03:02
  • @mario is that possible in the android app developer? – Hybride Jun 12 '15 at 19:05
  • you can't upload more than 1 image at a time using **MIT App Inventor**. Therefore just upload them one by one similar to this download example https://puravidaapps.com/filebyfile.php – Taifun Jun 14 '15 at 14:19

0 Answers0