2012-03-05 3 views
0

PHP를 사용하여 Excel 파일을 만들고 있습니다. PHP는 파일을 생성하지만 파일의 사용 권한은 '읽기 전용'으로 설정됩니다. 사용자가 파일을 편집 할 수있는 권한을 갖고 싶습니다. 서버에 새 파일을 만들지는 않습니다. 다른 모든 파일이 실패 할 경우 해당 옵션을 예약하고 싶습니다.브라우저로 플러시 출력에 대한 사용 권한을 변경하는 방법은 무엇입니까?

header("Pragma: public"); 
header("Expires: 0"); 
header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
header("Content-Type: application/force-download"); 
header("Content-Type: application/octet-stream"); 
header("Content-Type: application/download");; 
header("Content-Disposition: attachment;filename=$filename ");  
header("Content-Transfer-Encoding: binary "); 

$out = ob_get_clean(); 
echo $out; 
xlsEOF(); 
exit(); 
+4

콘텐츠 유형 헤더가 3 개 있지만 Excel 문서의 경우 'application/vnd.ms-excel'이어야합니다. – Quentin

+0

잘 Quentin 발견, 고마워. – Conor

답변

1

이 실제 문제가되지 않습니다 :

다음은 관련 코드입니다.

Linux에서 파일을 다운로드 한 사용자에게는 파일 편집 권한이 있지만 다른 사용자에게는 '읽기 전용'권한 (첨부 된 이미지 참조) 만 있습니다.

Windows 사용자도 '읽기 전용'속성을 볼 것으로 가정했기 때문에 '문제'는 잘못된 전제의 결과입니다. the red asterisks on the image show the file permissions. I was incorrectly assuming the 'read only' attribute would be associated files in Windows as well

+0

그래, 클라이언트 쪽에서는 정상적인 사용 권한 일뿐입니다. PHP 또는 HTTP와는 아무 관련이 없습니다. –

관련 문제