add docxmov

hotfix/远程访问多媒体中心
LMR 7 years ago
parent b732fe9fc1
commit 24ed3c6621

@ -14,8 +14,10 @@ class Info_amp extends CI_Controller
$this->load->model('InfoContents_model');
$this->load->model('Information_model');
$this->site_code = $this->config->item('site_code');
//CORS TEST
header('Access-Control-Allow-Origin:*');
//CORS
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:GET,PUT,POST,DELETE,OPTIONS');
header('Access-Control-Allow-Headers:Content-Type,Authorization,Content-Length,X-Requested-With,Accept,x-csrf-token,origin');
}
public function save_amp()
@ -357,5 +359,29 @@ class Info_amp extends CI_Controller
)));
}
}
public function handel_word_source() {
$file = $_FILES['file'];
if (!$file) return;
//转移文件
$path = realpath('../cht-system/views/information/word_source').'/'.basename($file['name']);
if (move_uploaded_file($file['tmp_name'], $path)) {
$msg = "File is valid, and was successfully uploaded: ".$path;
} else {
$msg = "Possible file upload attack!";
}
if($file) {
echo(json_encode(array(
'status' => 'success',
'msg' => $msg
)));
} else {
echo(json_encode(array(
'status' => 'error',
'msg' => $msg
)));
}
}
}

Loading…
Cancel
Save