Beispiel #1
0
                $time += JIRAFEAU_MONTH;
                break;
            case 'year':
                $time += JIRAFEAU_YEAR;
                break;
            default:
                $time = JIRAFEAU_INFINITY;
                break;
        }
    }
    // Check file size
    if ($cfg['maximal_upload_size'] > 0 && $_FILES['file']['size'] > $cfg['maximal_upload_size'] * 1024 * 1024) {
        echo 'Error';
        exit;
    }
    $res = jirafeau_upload($_FILES['file'], isset($_POST['one_time_download']), $key, $time, get_ip_address($cfg), $cfg['enable_crypt'], $cfg['link_name_length']);
    if (empty($res) || $res['error']['has_error']) {
        echo 'Error';
        exit;
    }
    /* Print direct link. */
    echo $res['link'];
    /* Print delete link. */
    echo NL;
    echo $res['delete_link'];
    /* Print decrypt key. */
    echo NL;
    echo urlencode($res['crypt_key']);
} elseif (isset($_GET['h'])) {
    $link_name = $_GET['h'];
    $key = '';
Beispiel #2
0
                $time += JIRAFEAU_MONTH;
                break;
            case 'year':
                $time += JIRAFEAU_YEAR;
                break;
            default:
                $time = JIRAFEAU_INFINITY;
                break;
        }
    }
    // Check file size
    if ($cfg['maximal_upload_size'] > 0 && $_FILES['file']['size'] > $cfg['maximal_upload_size'] * 1024 * 1024) {
        echo "Error";
        exit;
    }
    $res = jirafeau_upload($_FILES['file'], isset($_POST['one_time_download']), $key, $time, $_SERVER['REMOTE_ADDR'], $cfg['enable_crypt'], $cfg['link_name_length']);
    if (empty($res) || $res['error']['has_error']) {
        echo "Error";
        exit;
    }
    /* Print direct link. */
    echo $res['link'];
    /* Print delete link. */
    echo NL;
    echo $res['delete_link'];
    /* Print decrypt key. */
    echo NL;
    echo urlencode($res['crypt_key']);
} elseif (isset($_GET['h'])) {
    $link_name = $_GET['h'];
    $key = '';