파일을 다운받기 하면 오류 메시지가
Warning: fopen(): URL file-access is disabled in the server configuration in /home/hosting_users/newgmorg/www/bbs/down.php on line 20
Warning: fopen(http://아이피주소:100/mp3/2008/20081225.mp3): failed to open stream: no suitable wrapper could be found in /home/hosting_users/newgmorg/www/bbs/down.php on line 20
Warning: fpassthru(): supplied argument is not a valid stream resource in /home/hosting_users/newgmorg/www/bbs/down.php on line 21
Warning: fclose(): supplied argument is not a valid stream resource in /home/hosting_users/newgmorg/www/bbs/down.php on line 22
down.php 내용
<?
$code = "http://아이피주소:100/mp3";
$file="$code/$filename";
// 브라우저 골라서 헤더를 따로 따로 전송 해 준다.(5.5 일때는 다르게 해줘야 함)
if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
header("Content-Type: doesn/matter ");
header("Content-Disposition: filename=$filename ");
header("Content-Transfer-Encoding: binary ");
header("Pragma: no-cache");
header("Expires: 0");
}else{
Header("Content-type: file/unknown");
Header("Content-Disposition: attachment; filename=$filename");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
$fp = fopen("$file","r");
if (!fpassthru($fp))
fclose($fp);
?>
Warning: fopen(): URL file-access is disabled in the server configuration in /home/hosting_users/newgmorg/www/bbs/down.php on line 20
Warning: fopen(http://아이피주소:100/mp3/2008/20081225.mp3): failed to open stream: no suitable wrapper could be found in /home/hosting_users/newgmorg/www/bbs/down.php on line 20
Warning: fpassthru(): supplied argument is not a valid stream resource in /home/hosting_users/newgmorg/www/bbs/down.php on line 21
Warning: fclose(): supplied argument is not a valid stream resource in /home/hosting_users/newgmorg/www/bbs/down.php on line 22
down.php 내용
<?
$code = "http://아이피주소:100/mp3";
$file="$code/$filename";
// 브라우저 골라서 헤더를 따로 따로 전송 해 준다.(5.5 일때는 다르게 해줘야 함)
if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
header("Content-Type: doesn/matter ");
header("Content-Disposition: filename=$filename ");
header("Content-Transfer-Encoding: binary ");
header("Pragma: no-cache");
header("Expires: 0");
}else{
Header("Content-type: file/unknown");
Header("Content-Disposition: attachment; filename=$filename");
Header("Content-Description: PHP3 Generated Data");
header("Pragma: no-cache");
header("Expires: 0");
}
$fp = fopen("$file","r");
if (!fpassthru($fp))
fclose($fp);
?>
댓글을 작성하시려면 로그인이 필요합니다.
댓글 3개
그리하여. on 으로 설정해줘야하는데.. 보안상 않좋다고들 하네요.
소켓을 이용해보세요.
어떻게 해야할지...답이 아니면 비슷한 답이라도..ㅠㅠ 소켓은 전구소켓 밖에 몰라서..ㅠㅠ