2015-11-21 17:09:03 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) ); require_once __ROOT__.'/manager/security.php';
|
|
|
|
|
|
|
|
if( isset($_FILES['file']) && isset($_POST['filename']) ){
|
|
|
|
|
|
|
|
$path = __ROOT__.'/src/files/';
|
2015-11-25 17:17:34 +00:00
|
|
|
$fileName = $_SESSION['identifiant'].'_'.$_POST['filename'].'.xlsx';
|
|
|
|
|
|
|
|
// on se place dans /.../src/files
|
|
|
|
chdir( $path );
|
2015-11-21 17:09:03 +00:00
|
|
|
|
2015-11-25 17:17:34 +00:00
|
|
|
|
|
|
|
if( move_uploaded_file($_FILES["file"]["tmp_name"], $path.$fileName) ){
|
|
|
|
// on modifie les droits du fichier
|
|
|
|
chmod($path.$fileName, 0774);
|
2015-11-21 17:09:03 +00:00
|
|
|
echo "success";
|
2015-11-25 17:17:34 +00:00
|
|
|
}
|
2015-11-21 17:09:03 +00:00
|
|
|
else
|
|
|
|
echo "error";
|
|
|
|
|
|
|
|
}else
|
|
|
|
echo 'missing_param';
|
|
|
|
|
|
|
|
?>
|