소스 검색

Fixes Filemanager Download Issue

#220
Adjokip 8 년 전
부모
커밋
7c2733bc40
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 2
      js/modules/litefm.js
  2. 3 3
      modules/litefm/litefm.php

+ 2 - 2
js/modules/litefm.js

@@ -234,7 +234,7 @@ function downloadFile(home_id, file_id, file_size, file_name)
 	function getFilePart()
 	{
 		var xhr = new XMLHttpRequest();
-		xhr.open('POST', "home.php?m=litefm&home_id="+home_id+"&item="+file_id+"&p=get&type=cleared&size="+file_size+"&did="+did, true);
+		xhr.open('POST', "home.php?m=litefm&home_id="+home_id+"&item="+file_id+"&name="+file_name+"&p=get&type=cleared&size="+file_size+"&did="+did, true);
 		xhr.responseType = 'arraybuffer';
 		xhr.onload = function(e) {
 			if(this.response.byteLength != 0)
@@ -1040,4 +1040,4 @@ $(document).ready(function(){
 			alert(select_at_least_one_item);
 		}
 	});
-});
+});

+ 3 - 3
modules/litefm/litefm.php

@@ -52,9 +52,9 @@ function show_back($home_id)
 
 function litefm_check($home_id)
 {
-	if (isset($_GET['item']) and isset($_GET['name']) and !isset($_GET['upload']) and !isset( $_POST['delete'] ) and !isset( $_POST['create_folder'] ) and !isset( $_POST['secureButton'] ) and !isset( $_POST['delete_check'] ) and !isset( $_POST['secure_check'] ))
+	if (isset($_GET['item']) and !isset($_GET['upload']) and !isset( $_POST['delete'] ) and !isset( $_POST['create_folder'] ) and !isset( $_POST['secureButton'] ) and !isset( $_POST['delete_check'] ) and !isset( $_POST['secure_check'] ))
     {
-		$fileName = urldecode($_GET['name']);
+		$fileName = !empty($_POST['name']) ? urldecode($_POST['name']) : urldecode($_GET['name']);
 		if(isset($_GET['type'])){
 			$type = $_GET['type'];
 		}else{
@@ -96,4 +96,4 @@ function litefm_check($home_id)
 
     return TRUE;
 }
-?>
+?>