|
|
@ -960,11 +960,16 @@ class ArticleController extends AdminController {
|
|
|
|
$type = $upfile["type"];
|
|
|
|
$type = $upfile["type"];
|
|
|
|
$size = $upfile["size"];
|
|
|
|
$size = $upfile["size"];
|
|
|
|
$tmp_name = $upfile["tmp_name"];
|
|
|
|
$tmp_name = $upfile["tmp_name"];
|
|
|
|
$savePath = $_SERVER['DOCUMENT_ROOT'].__ROOT__.'/Documents/';
|
|
|
|
$savePath = $_SERVER['DOCUMENT_ROOT'].__ROOT__.'/Uploads/Documents/';
|
|
|
|
move_uploaded_file($tmp_name,$savePath.$name);
|
|
|
|
if (is_dir($savePath)) {
|
|
|
|
|
|
|
|
move_uploaded_file($tmp_name,$savePath.$name);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
mkdir($savePath, 0777, true);
|
|
|
|
|
|
|
|
move_uploaded_file($tmp_name,$savePath.$name);
|
|
|
|
|
|
|
|
}
|
|
|
|
$file_name = $savePath.$name;
|
|
|
|
$file_name = $savePath.$name;
|
|
|
|
$error=$upfile["error"];//上传后系统返回的值
|
|
|
|
$error=$upfile["error"];//上传后系统返回的值
|
|
|
|
$data['document_route'] = 'Documents/'.$name;
|
|
|
|
$data['document_route'] = 'Uploads/Documents/'.$name;
|
|
|
|
$updateres = M('document_pop_rules')->where(['id' => $id])->save($data);
|
|
|
|
$updateres = M('document_pop_rules')->where(['id' => $id])->save($data);
|
|
|
|
if ($updateres) {
|
|
|
|
if ($updateres) {
|
|
|
|
$backData['code'] = 10000;
|
|
|
|
$backData['code'] = 10000;
|
|
|
|