1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 09:34:54 +02:00

Fixes #651 - Media-Manager - Uploaded file does not display in selection.

This commit is contained in:
Cameron
2015-02-07 11:57:28 -08:00
parent 8afe6edfea
commit 25b96411e0
4 changed files with 44 additions and 22 deletions

View File

@@ -140,12 +140,23 @@ if (!$chunks || $chunk == $chunks - 1) {
}
// rename($targetDir.$fileName,e_MEDIA."images/2012-05/",$fileName);
if($_GET['for'] !='') // leave in upload directory if no category given.
{
$result = e107::getMedia()->importFile($fileName,$_GET['for']);
}
$log = $_GET;
$log['filepath'] = $filePath;
$log['filename'] = $fileName;
$log['status'] = ($result) ? 'ok' : 'failed';
$type = ($result) ? E_LOG_INFORMATIVE : E_LOG_WARNING;
e107::getLog()->add('Media Upload', print_r($log,true), $type, MEDIA_01);
$array = array("jsonrpc"=>"2.0", "result"=>$result,"id"=>"id");
echo json_encode($array);