서버내 파일이 아닌 외부파일의 파일크기를 알아내고 싶습니다
그럴러면 파일 한개를 다 받고 체크를 해야 될것 같아 헤더만 받아서 content-lenght 값을 읽어오면 될것 같은데..
외부파일(URL)의 header 정보만 가져오는 방법이 있습니까
|
답변 1개
채택된 답변
+20 포인트
아름다운세상
2015-04-10 (금) 10:30:44
method를 head로 날리시면 되요~
cURL 사용중이시면
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true); 로 설정해주시면 되요~
http://php.net/manual/en/function.get-headers.php
이런것도 있어요(allow_url_fopen 설정에 영향 받아요.)
cURL 사용중이시면
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true); 로 설정해주시면 되요~
http://php.net/manual/en/function.get-headers.php
이런것도 있어요(allow_url_fopen 설정에 영향 받아요.)
답변을 작성하려면 로그인이 필요합니다.