TA的每日心情 | 难过 昨天 22:31 |
---|
签到天数: 1652 天 [LV.Master]伴坛终老
|
本帖子是对php批量上传的实现代码进行了详细的分析介绍,需要的会员可以参考下:
直接上代码:
- if (isset($_POST['submit'])) {
- foreach($_FILES['product_img']['error'] as $k=>$v){
- if ($v == UPLOAD_ERR_OK) {
- $sql ='product_img'.($k+1);
- $tmp_name = $_FILES['product_img']['tmp_name'][$k];
- $file_name = $_FILES['product_img']['name'][$k];
- $file_type = $_FILES['product_img']['type'][$k];
- $upload_name = getPath('../Public/Upload').time().'_'.$file_name;
- @move_uploaded_file($tmp_name,$upload_name);
- $map[$sql] = $file_name;
- print_r($map);
- exit;
- }
- }
- }
复制代码 |
|