sid/manager/import.php

23 lines
558 B
PHP
Executable File

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