'sex' => '' ); json('yes','上传成功',$resJson); }else{ json('no','update faile',''); }* / json('no','上传失败'.$uppic.$is_weed['headurl'],''); } }*/ $fid = get_fid(); if (empty($fid)) { //抽空吧这里改成存储到本服务器 json('no', '上传失败-图片服务器不可用', ''); } //×××××××××××××××××待做查看本机通过公网访问图片服务器的收到地址 $uppic = update_pic($post_data, 'http://172.18.1.23:8081/' . $fid); $uppicobj = json_decode($uppic); if ($uppicobj->size > 0) { $new_pic = 'http://file.fujinde.com:8081/' . $fid; $resJson = array('headurl' => $new_pic, 'nickname' => "", 'age' => "", 'sex' => '', 'zhiye' => "", 'qianming' => ""); /****方案二,图片上传后吧原来的删掉***/ $is_weed = $db->row_select_one("user", "umd5 = '{$u_pic_user}'", "headurl"); $pos = strpos($is_weed['headurl'], "file.fujinde.com:8081"); if ($pos) { //print_r(delete_pic($is_weed['headurl'])); $old_temp = $is_weed['headurl']; } $update = array("headurl" => $new_pic); $db->row_update('user', $update, "umd5 = '{$u_pic_user}' "); //需要改成内部服务器地址 delete_pic(str_replace('file.fujinde.com', '172.18.1.23', $old_temp));
$filename = date("Ymdhis") . '_' . rand(0, 100) . $extension; $thumbpic = "./temp/thumb_" . $filename; img2thumb($tmpfile, $thumbpic); //$myfile="./temp/".$filename; /*****上传至weed服务器*****/ $fid = get_fid(); if (empty($fid)) { //抽空吧这里改成存储到本服务器 json('no', '上传失败-图片服务器不可用', ''); } $post_data['file'] = '@' . $tmpfile; //原图 $uppic = update_pic($post_data, 'http://127.0.0.1:8081/' . $fid . '_1'); $post_thumb_data['file'] = '@' . $thumbpic; //缩略图 $uppic_thumb = update_pic($post_thumb_data, 'http://127.0.0.1:8081/' . $fid); $uppicobj_thumb = json_decode($uppic_thumb); $uppicobj = json_decode($uppic); if ($uppicobj->size > 0 && $uppicobj_thumb->size > 0) { @unlink($uppic_thumb); $fids[$i] = 'http://file.fujinde.com:8081/' . $fid; } else { json('no', '图片服务器错误', ''); } } else { json('no', '非法上传', ''); } } $insert = array("content" => addslashes($content), "jwd" => $jwd, "pic" => json_encode($fids), 'time' => time(), 'is_del' => 1, "umd5" => $user); $res = $db->row_insert('gushi', $insert); if ($res) {