Пример #1
0
function make_dir($path)
{
    if (!is_dir($path)) {
        @mkdir($path, 0707);
        @chmod($path, 0707);
        if (!is_dir($path)) {
            alert_only('디렉토리 생성에 실패하였습니다.');
        }
        add_index($path);
    }
}
Пример #2
0
}
if ($work == 'delete') {
    delete_image($token, EDITOR_YM_PATH);
    exit;
}
$file = $_FILES['image'];
$size = getImageSize($file['tmp_name']);
$mime = array('image/png', 'image/jpeg', 'image/gif');
if (!is_uploaded_file($file[tmp_name])) {
    alert_only("첨부파일이 업로드되지 않았습니다.\\n\\n{$file['error']}");
}
if (!in_array($size['mime'], $mime)) {
    alert_only("PNG, GIF, JPG 형식의 이미지 파일만 업로드 가능합니다.");
}
if (!preg_match("/\\.(jpg|png|gif)\$/i", $file[name])) {
    alert_only("PNG, GIF, JPG 형식의 이미지 파일만 업로드 가능합니다.");
}
delete_image($token, EDITOR_YM_PATH);
$real_filename = duplicate_filename(EDITOR_YM_PATH, $file['name']);
$real_filepath = EDITOR_YM_PATH . '/' . $real_filename;
move_uploaded_file($file['tmp_name'], $real_filepath);
chmod($real_filepath, 0606);
setCookie('ge_token', $token);
setCookie('ge_file', $real_filepath);
?>
<script type="text/javascript">
parent.<?php 
echo $obj;
?>
.insert_image_preview("<?php 
echo EDITOR_YM_URL . '/' . $real_filename;