【发布时间】:2015-01-08 07:09:53
【问题描述】:
我是使用 PHP for Android 设备的 web 服务新手。我需要处理多个图像上传概念。请建议。我已经实现了单个上传的概念,下面给出了单个文件上传的代码。
$data = $_REQUEST;
if($data["prop_images"]){
$filename = md5(time()).'.jpg';
$base=$data["prop_images"];
$binary = base64_decode($base);
$pathtoupload = JPATH_ADMINISTRATOR . '/components/com_clinchproperties/galupload/';
//header('Content-Type: bitmap; charset=utf-8'); // binary, utf-8 bytes
$actual_image_name = time().".jpg";
$image = $filename;
$file = fopen($pathtoupload.$filename, 'wb');
fwrite($file, $binary);
fclose($file);
}
我需要代码来同时上传 n 张图片。有人可以帮我吗?提前致谢。
【问题讨论】:
-
你想同时上传4个还是5个文件?解释一下
-
是的,我需要同时上传 n 个文件
-
如果从 db 中获取 $data,则在 while 循环中编写上传代码
-
@user3386779 有没有网站可以检查从浏览器上传的文件?因为我需要检查我是如何从用户那里接收数据的
标签: php android web-services file-upload