|
|
@@ -22,6 +22,13 @@ if(!isset($_GET["file"])){
|
|
|
die('["File Error"]');
|
|
|
}
|
|
|
*/
|
|
|
+
|
|
|
+if(strpos(exec('uname -m'), 'arm') !== false){
|
|
|
+ $executions = "7za";
|
|
|
+}else{
|
|
|
+ $executions = "7za_x64";
|
|
|
+}
|
|
|
+
|
|
|
if($_GET["method"] == "ListAORDir"){
|
|
|
$result = [];
|
|
|
$dir = $_GET["dir"] !== "" ? "../".$_GET["dir"]."/" : "../";
|
|
|
@@ -83,11 +90,11 @@ if($_GET["method"] == "ListAORDir"){
|
|
|
}else if($_GET["method"] == "e"){
|
|
|
$rand = $_GET["rand"];
|
|
|
mkdir('tmp/'.$rand,0777);
|
|
|
- system('./7za e -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
|
|
|
+ system('./'.$executions.' e -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
|
|
|
echo json_encode(array("Extract finished. e"));
|
|
|
}else if($_GET["method"] == "x"){
|
|
|
$rand = $_GET["rand"];
|
|
|
mkdir('tmp/'.$rand,0777);
|
|
|
- system('./7za x -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
|
|
|
+ system('./'.$executions.' x -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages',$output);
|
|
|
echo json_encode(array("Extract finished. x"));
|
|
|
-}
|
|
|
+}
|