|
@@ -34,6 +34,8 @@ class Core
|
|
|
protected $base64 = false;
|
|
|
|
|
|
protected $yun = false;
|
|
|
+
|
|
|
+ protected $id = false;
|
|
|
|
|
|
/**
|
|
|
* __construct
|
|
@@ -190,7 +192,7 @@ class Core
|
|
|
$file = base64_decode($file);
|
|
|
$name = $this->data['local'] = Dever::local($this->data['pic']);
|
|
|
$size = strlen($file);
|
|
|
- $size = ($size - ($size/8)*2)/1024;
|
|
|
+ $size = number_format(($size - ($size/8)*2)/1024, 2);
|
|
|
$this->base64 = true;
|
|
|
} else {
|
|
|
$name = urldecode($this->data['file']);
|
|
@@ -298,6 +300,15 @@ class Core
|
|
|
|
|
|
$this->output['status'] = 1;
|
|
|
$this->output['name'] = $this->data['file']['name'];
|
|
|
+ $this->output['fid'] = $this->id;
|
|
|
+ if ($this->limit) {
|
|
|
+ $this->output['width'] = $this->limit[0];
|
|
|
+ $this->output['height'] = $this->limit[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($this->size) {
|
|
|
+ $this->output['size'] = $this->size;
|
|
|
+ }
|
|
|
|
|
|
return $this->output;
|
|
|
}
|
|
@@ -323,7 +334,7 @@ class Core
|
|
|
$param['set_size'] = $this->size;
|
|
|
}
|
|
|
|
|
|
- $param['where_id'] = $id;
|
|
|
+ $this->id = $param['where_id'] = $id;
|
|
|
|
|
|
Dever::load('upload/file-update', $param);
|
|
|
}
|
|
@@ -354,7 +365,7 @@ class Core
|
|
|
|
|
|
//file_put_contents(DEVER_PATH . 'data/test', var_export($param,true));
|
|
|
|
|
|
- Dever::load('upload/file-insert', $param);
|
|
|
+ $this->id = Dever::load('upload/file-insert', $param);
|
|
|
}
|
|
|
|
|
|
private function img()
|