فهرست منبع

Add files via upload

yeungalan 6 سال پیش
والد
کامیت
0135822281
2فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. BIN
      7-Zip File Manager/7za_x86
  2. 10 3
      7-Zip File Manager/opr.php

BIN
7-Zip File Manager/7za_x86


+ 10 - 3
7-Zip File Manager/opr.php

@@ -22,6 +22,12 @@ if(!isset($_GET["file"])){
 	die('["File Error"]');
 }
 */
+if(strpos(exec('uname -m'), 'arm') !== false){
+	$executions = "7za";
+}else{
+	$executions = "7za_x86";
+}
+
 if($_GET["method"] == "ListAORDir"){
 	$result = [];
 	$dir = $_GET["dir"] !== "" ?  "../".$_GET["dir"]."/" : "../";
@@ -39,7 +45,7 @@ if($_GET["method"] == "ListAORDir"){
 	$filesnumber = -1;
 	$FileInformation = [];
 	$SevenZHeader = [];
-	exec('sudo ./7za l "'.$_GET["file"].'" -ba -slt',$output);
+	exec('sudo ./'.$executions.' l "'.$_GET["file"].'" -ba -slt',$output);
 	if($_GET["dir"] !== ""){
 		$dir = $_GET["dir"];
 	}else{
@@ -83,11 +89,12 @@ 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 './'.$executions.' e -bsp1 -bso0 "'.$_GET["file"].'" "'.$_GET["dir"].'" -o"tmp/'.$rand.'/" > tmp/'.$rand.'messages';
 	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"));
 }