Initial commit

This commit is contained in:
2020-10-10 22:40:27 +03:00
commit a228f94dd0
11 changed files with 476 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<?php
$mode=$_POST['mode'];
$file=$_FILES['file'];
if (!is_dir(dirname(__file__).'/files')){
mkdir(dirname(__file__).'/files');
}
$path=dirname(__file__).'/files/'.basename($file['name']);
move_uploaded_file($file['tmp_name'],$path);
$result=json_decode((string)shell_exec('python '.dirname(__file__).'/huffman.py -'.($mode=='compress'?'c':'d').' "'.$path.'"'));
header('Content-Type: application/json');
echo json_encode($result);
?>