想用multiple这个属性,后台php这样写对吗?
<formmethod="post"action="add.handle.php"enctype="multipart/form-data"><inputtype="fi...
<form method="post" action="add.handle.php" enctype="multipart/form-data">
<input type="file" multiple name="images"></input>
</form>
if(is_array($_FILES['images']['tmp_name'])){
foreach ($_FILES['images']['tmp_name'] as $key => $value){
if(is_uploaded_file($_FILES['images']['tmp_name'][$key])){
copy($_FILES['images']['tmp_name'][$key],"../uploads/".$_FILES['images']['name'][$key]);
}
}
} 展开
<input type="file" multiple name="images"></input>
</form>
if(is_array($_FILES['images']['tmp_name'])){
foreach ($_FILES['images']['tmp_name'] as $key => $value){
if(is_uploaded_file($_FILES['images']['tmp_name'][$key])){
copy($_FILES['images']['tmp_name'][$key],"../uploads/".$_FILES['images']['name'][$key]);
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询