|
@@ -7,7 +7,7 @@
|
|
|
namespace Upload\Src;
|
|
|
|
|
|
use Dever;
|
|
|
-use Upload\Src\Store\Local as Handle;
|
|
|
+use Upload\Src\Store\Handle;
|
|
|
use Upload\Src\Lib\Img;
|
|
|
|
|
|
class View
|
|
@@ -185,6 +185,7 @@ class View
|
|
|
$host = Dever::config('host')->uploadRes;
|
|
|
$root = Dever::data() . 'upload/';
|
|
|
$dest = str_replace(array('{uploadRes}', $host), $root, $file);
|
|
|
+ $path = str_replace(array('{uploadRes}', $host), '', $file);
|
|
|
if (strstr($source, $host)) {
|
|
|
|
|
|
$source = $root . str_replace($host, '', $source);
|
|
@@ -201,9 +202,13 @@ class View
|
|
|
}
|
|
|
|
|
|
if (!strstr($dest, 'http://') && !is_file($dest)) {
|
|
|
- $handle = new Handle();
|
|
|
+ $temp = explode('/', $path);
|
|
|
+ $key = $temp[0];
|
|
|
+ $image['file'] = false;
|
|
|
+ $image['key'] = $key;
|
|
|
+ $handle = new Handle($image);
|
|
|
$method = 'handle_' . $type;
|
|
|
- $handle->$method($id, $source, $dest);
|
|
|
+ $file = $handle->$method($id, $source, $dest, $path);
|
|
|
}
|
|
|
}
|
|
|
|