|
@@ -49,21 +49,9 @@ class Common extends CI_Controller {
|
|
|
|
|
|
$type = intval($this->input->post("fileType",true));
|
|
|
|
|
|
- if ($type == 0) {
|
|
|
- $path = '../upload/image';
|
|
|
- $config['file_name'] = md5(uniqid()); // 设置图片名字
|
|
|
- }else{
|
|
|
- $config['overwrite'] = true;
|
|
|
- $filename = trim($_FILES['file']['name']);
|
|
|
- if (strpos($filename, 'LampControl_') !== false) {
|
|
|
- $path = '../upload/firewalld';
|
|
|
- $config['file_name'] = $filename;
|
|
|
- }else{
|
|
|
- $path = '../upload/firewalld';
|
|
|
- $config['file_name'] = 'openwrt-'.md5(uniqid());
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ $path = '../upload/image';
|
|
|
+ $config['file_name'] = md5(uniqid()); // 设置图片名字
|
|
|
+
|
|
|
if (!file_exists($path)) {
|
|
|
mkdir($path);
|
|
|
}
|
|
@@ -88,11 +76,7 @@ class Common extends CI_Controller {
|
|
|
{
|
|
|
$data = $this->upload->data();
|
|
|
|
|
|
- if ($type == 0) {
|
|
|
- $imagePath = '/upload/image/'.$data['file_name'];
|
|
|
- }else{
|
|
|
- $imagePath = '/upload/firewalld/'.$data['file_name'];
|
|
|
- }
|
|
|
+ $imagePath = '/upload/image/'.$data['file_name'];
|
|
|
|
|
|
exit(json_result('0000',$this->response['0000'],array('path'=>base_url($imagePath))));
|
|
|
}
|