echo "$file[0][file]"; 이라고 하면, Array[file] 이라고 떠버려요.
안녕하세요. :)
파일명을 호출해야 되는데요.
write.skin.php 에서 echo "$file[0][file]"; 이라고 하면,
Array[file] 이라고 떠버려요.
3546904101_Nyi7HAVW_29.jpg 이런식으로 암호가 들어간 파일명을 호출하려면
어떻게해야 되나요?
도움 부탁드려요~
답변 4개 / 댓글 3개
write.skin.php 에서 echo "$file[0][file]"; 이라고 하면,<---
write.skin.php 에서 echo $file[0][file]; 또는 echo "{$file[0][file]}";<-- 이 경우 따옴표는 필요없어요
$delfile1 = "$g4[path]/data/file/$bo_table/$file[0][file]"; <--
$delfile1 = "$g4[path]/data/file/$bo_table/".$file[0][file];
또는
$delfile1 = "$g4[path]/data/file/$bo_table/{$file[0][file]}";
답변에 대한 댓글 1개
$file[file][0][file]
이런형태가 되어야 할것으로 보입니다..
답변에 대한 댓글 1개
Warning: unlink(../data/file/sample1/[0][file]) [function.unlink]: No such file or directory
이렇게 경고가 뜨는데, 다른 해결 방법이 없을까요?
if ($w == "u")
{
for ($i=0; $i<$file[count]; $i++)
{
$row = sql_fetch(" select bf_file, bf_content from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '$i' ");
if ($row[bf_file])
{
$file_script .= "add_file(\"<input type='checkbox' name='bf_file_del[$i]' value='1'><a href='{$file[$i][href]}'>{$file[$i][source]}({$file[$i][size]})</a> Delete";
if ($is_file_content)
//$file_script .= "<br><input type='text' class=text size=50 name='bf_content[$i]' value='{$row[bf_content]}' title='업로드 이미지 파일에 해당 되는 내용을 입력하세요.'>";
// 첨부파일설명에서 ' 또는 " 입력되면 오류나는 부분 수정
$file_script .= "<br><input type='text' class=text size=50 name='bf_content[$i]' value='".addslashes(get_text($row[bf_content]))."' title='Enter contents corresponding to upload an image file.'>";
$file_script .= "\");\n";
}
else
$file_script .= "add_file('');\n";
}
$file_length = $file[count] - 1;
}
바로 출력이 아닌 위 구문을 활용해 보시기 바랍니다..
답변에 대한 댓글 1개
파일을 강제로 삭제해주어야 되어서요.
<?
$delfile1 = "$g4[path]/data/file/$bo_table/$file[0][file]";
unlink($delfile1);
?>
이런식으로 삭제를 하려고 하는데, 잘 안되네요.
답변을 작성하려면 로그인이 필요합니다.
좋은 하루 되세요. :)