我正在使用 MIT App Inventor 测试我的运气,并尝试将一个以上的图像一次POST到我的PHP脚本中以插入数据库。我已经成功发布了1张图片,但使用file_get_contents似乎不仅仅是1。我试过了
$remote_content = explode("\n", file_get_contents('php://stdin'));
file_put_contents($upload_dir . $filename, $remote_content[0]); //etc
但所有图片都有0KB。也试过循环(foreach),同样缺乏成功。
还有其他选择吗?或者这应该在应用程序方面以不同方式发布?现在,它一次性全部发布(所以
if not is empty image1,
postFile image1
if not is empty image2
postFile image 2
等