제가 했던 방법인데... 참고하세요..
제가 했던 방법입니다..
자세한 기술적인 방법이나 용어는 모르구요...
url을 변수로 넘겨줄때 보통 urlencode로 변환해서 넘겨 주더라구요..
그걸 응용한것입니다.. 한글이름의 경우 변환되어서..특수문자들로 보여지죠..
아래 내용은 lib.inc.php 729라인쯤의 내용입니다.
============================================================================================================
// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file)
{
global $cfg, $board, $reldir;
if (!$file) return;
$size = @getimagesize("$reldir/$cfg[dir_file]/$board[bo_table]/$file");
$source_width = $size[0];
$source_height = $size[1];
if ($board[bo_table_width] <= 100) {
if ($size[0] > $cfg[large_image_size]) {
$rate = $size[1] / $size[0];
$size[0] = $cfg[large_image_size];
$size[1] = (int)($size[0] * $rate);
}
} else {
if ($size[0] > $board[bo_table_width]) {
$rate = $size[1] / $size[0];
$size[0] = $board[bo_table_width];
$size[1] = (int)($size[0] * $rate);
}
}
$width = $size[0];
$height = $size[1];
if (preg_match($cfg[image_extension], $file))
return "<img src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height' border=0><p>";
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file'></embed><p>";
}
============================================================================================================
위 내용이 게시판에 이미지 업로드시 이미지 동영상 플래쉬 테그를 만들어 주는 부분인데..
여기서 저는 일단 이미지 파일만 건드렸습니다..
아래 처럼...
============================================================================================================
if (preg_match($cfg[image_extension], $file)) { <== 요거 열고..
// 한글파일 보이게 해주는 꽁수
$file= urlencode($file); <============== 이부분 추가했어요..
return "<img src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height' border=0><p>";
} <== 요거 닫고..
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file'></embed><p>";
============================================================================================================
도움이 되실지 모르겠네요..^^
아래는 게시판에서 한글 이미지 업로드 후에 보여지는 이미지 이름입니다.
원래 이름은..
내마음은...콩밭에.jpg
변환후...
92a472b5_%B3%BB%B8%B6%C0%BD%C0%BA...%C4%E1%B9%E7%BF%A1.jpg
--------------------------------------------------------------
자세한 기술적인 방법이나 용어는 모르구요...
url을 변수로 넘겨줄때 보통 urlencode로 변환해서 넘겨 주더라구요..
그걸 응용한것입니다.. 한글이름의 경우 변환되어서..특수문자들로 보여지죠..
아래 내용은 lib.inc.php 729라인쯤의 내용입니다.
============================================================================================================
// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file)
{
global $cfg, $board, $reldir;
if (!$file) return;
$size = @getimagesize("$reldir/$cfg[dir_file]/$board[bo_table]/$file");
$source_width = $size[0];
$source_height = $size[1];
if ($board[bo_table_width] <= 100) {
if ($size[0] > $cfg[large_image_size]) {
$rate = $size[1] / $size[0];
$size[0] = $cfg[large_image_size];
$size[1] = (int)($size[0] * $rate);
}
} else {
if ($size[0] > $board[bo_table_width]) {
$rate = $size[1] / $size[0];
$size[0] = $board[bo_table_width];
$size[1] = (int)($size[0] * $rate);
}
}
$width = $size[0];
$height = $size[1];
if (preg_match($cfg[image_extension], $file))
return "<img src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height' border=0><p>";
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file'></embed><p>";
}
============================================================================================================
위 내용이 게시판에 이미지 업로드시 이미지 동영상 플래쉬 테그를 만들어 주는 부분인데..
여기서 저는 일단 이미지 파일만 건드렸습니다..
아래 처럼...
============================================================================================================
if (preg_match($cfg[image_extension], $file)) { <== 요거 열고..
// 한글파일 보이게 해주는 꽁수
$file= urlencode($file); <============== 이부분 추가했어요..
return "<img src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height' border=0><p>";
} <== 요거 닫고..
else if (preg_match($cfg[flash_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file' width='$width' height='$height'></embed><p>";
else if (preg_match($cfg[movie_extension], $file))
return "<embed src='$reldir/$cfg[dir_file]/$board[bo_table]/$file'></embed><p>";
============================================================================================================
도움이 되실지 모르겠네요..^^
아래는 게시판에서 한글 이미지 업로드 후에 보여지는 이미지 이름입니다.
원래 이름은..
내마음은...콩밭에.jpg
변환후...
92a472b5_%B3%BB%B8%B6%C0%BD%C0%BA...%C4%E1%B9%E7%BF%A1.jpg
--------------------------------------------------------------
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 5개
그러나 일단 나타난 현상만으로볼때, 익스플로러 6.0이상, 윈 XP에서는 안 통합니다.
윈98의 경우는 제가 테스트해볼 환경이 안되기때문에 잘 모르겠으니, 이글을 보시는 분들중
위에것을 해보시고 되는분은 말씀해 주십시요.
잘쓰겠습니다.
그리고 한글문제보단 공백 문제가 더 큰거 같습니다
한글 문제는 브라우저 옵션에서 고쳐 주면 되지만, 공백 문제는 그렇게 해결될 문제가 아니죠
저는 공백을 '_' 으로 치환 해버렸습니다
이미지 문제는 urlencode 로, 공백 문제는 eregi_replace로 해결을 했는데 문제는 다운로드 할때 파일명에 공백이 있으면 이름 자체가 바껴져 보이니까 문젭니다
다운로드 할때는 원래 파일명으로 돌려주는 방법을 연구 중입니다만, 어렵군요...