Esempio n. 1
0
        nicupload_error('Server error, failed to move file');
    }
    $status = array();
    if ($rfc1867) {
        $status = apc_fetch('upload_' . $id);
    }
    if (!$status) {
        $status = array();
    }
    $status['done'] = 1;
    $status['width'] = $size[0];
    $status['url'] = $filename;
    if ($rfc1867) {
        apc_store('upload_' . $id, $status);
    }
    dosyaKaydet(strtolower($filename), getUserID2($_SESSION["usern"]));
    trackUser($currentFile, "success,FileUp", $_SESSION["usern"]);
    $status['id'] = getDosyaID($filename);
    nicupload_output($status, $rfc1867);
    exit;
} else {
    if (isset($_GET['check'])) {
        // Upload progress check
        $check = $_GET['check'];
        if (!is_numeric($check)) {
            nicupload_error('Invalid upload progress id');
        }
        if ($rfc1867) {
            $status = apc_fetch('upload_' . $check);
            if ($status['total'] > 500000 && $status['current'] / $status['total'] < 0.9) {
                // Large file and we are < 90% complete
Esempio n. 2
0
                 $result = -7;
                 trackUser($currentFile, "fail,FileUp", $_SESSION["usern"]);
             } else {
                 if (strlen($_FILES['myfile']['name'] > 50)) {
                     $result = -6;
                     trackUser($currentFile, "fail,FileUp", $_SESSION["usern"]);
                 } else {
                     try {
                         $target_path = $destination_path . basename(strtolower($_FILES['myfile']['name']));
                         if (file_exists($target_path)) {
                             $result = -2;
                             trackUser($currentFile, "fail,FileUp", $_SESSION["usern"]);
                         } else {
                             if (@move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
                                 $result = 1;
                                 dosyaKaydet(strtolower($_FILES['myfile']['name']), getUserID2($_SESSION["usern"]));
                                 trackUser($currentFile, "success,FileUp", $_SESSION["usern"]);
                             } else {
                                 $result = 0;
                             }
                         }
                     } catch (Exception $e) {
                         echo "<script>alert('Hata : {$e}');</script>";
                         trackUser($currentFile, "fail,FileUp", $_SESSION["usern"]);
                         $result = 0;
                     }
                 }
             }
         }
     }
 }