Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/main/inc/ajax/document.ajax.php

16 lines
478 B

<?php
/* For licensing terms, see /license.txt */
/**
* Responses to AJAX calls for the document upload
*/
require_once '../global.inc.php';
if (api_is_anonymous()){
exit;
}
if(!empty($_FILES)) {
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
DocumentManager::upload_document($_FILES, $_POST['curdirpath'], '', '', 0);
$file = $_FILES['file'];
echo '{"name":"'.$file['name'].'","type":"'.$file['type'].'","size":"'.$file['size'].'"}';
}
exit;