리눅스 서버의 폴더에있는 파일에 액세스하고 배치 로그인 한 사용자가 허용하는 방법 :만에이 코드 조각을 내가 <strong>htaccess로 파일</strong>을 만들어
여기Order Deny,Allow
Deny from all
내 PHP 코드 인 내 창문에 WAMP SERVER가있는 컴퓨터에서 잘 작동하고 있습니다 :
$path = $data['path']; // complete path to file
if (is_user_logged_in()) {
//return $path;
if (file_exists($path)) {
header('Cache-Control: public');
header('Content-Description: File Transfer');
header('Content-Type: application/pdf');
header('Content-Transfer-Encoding: binary');
readfile($path);
}
} else {
return 'Welcome, visitor!';
}
그러나 서버에서 실행하면 전혀 작동하지 않습니다. 잠긴 폴더가 있는데 여기에 .htaccess
파일이 있습니다. 잠긴 폴더 아래에는 로그인 한 사용자로만 액세스를 제한하려는 많은 하위 폴더가 있습니다.
무엇이 오류 로그 –
파일 (pdf 파일)을 열지 못했습니다 무엇입니까. 하지만 .htaccess 파일을 제거하면 문제없이 열립니다. – atif
잠금 및 잠금 해제는 무엇을 의미합니까? – saji89