|
@@ -50,7 +50,7 @@ function create_uuid($prefix = "") {
|
|
|
if ($_POST)
|
|
|
{
|
|
|
$base_path = BASE_ROOT_PATH . '/data/upload/upfile';
|
|
|
- $base_site_path = BASE_SITE_URL . '/data/upload/upfile';
|
|
|
+ $base_site_path = '/data/upload/upfile';
|
|
|
$ret = array();
|
|
|
|
|
|
if ($_FILES["file"]["error"] > 0) {
|
|
@@ -60,11 +60,12 @@ if ($_POST)
|
|
|
{
|
|
|
$fn = $_FILES["file"]["name"];
|
|
|
$ext_name = '.' . strtolower(pathinfo($fn)['extension']);
|
|
|
- $dest_file = $base_path . '/' . date("YmdHis") . '-' . create_uuid() . $ext_name;
|
|
|
+ $filename = date("YmdHis") . '-' . create_uuid() . $ext_name;
|
|
|
+ $dest_file = $base_path . '/' . $filename;
|
|
|
$result = move_uploaded_file($_FILES["file"]["tmp_name"],$dest_file);
|
|
|
if ($result) {
|
|
|
$ret['file_path'] = $dest_file;
|
|
|
- $ret['file_site_path'] = $base_site_path;
|
|
|
+ $ret['file_site_path'] = $base_site_path .'/' . $filename;
|
|
|
upfile_joutput_data($ret);
|
|
|
} else {
|
|
|
upfile_joutput_error();
|