Ejemplo n.º 1
0
    /* Read file. */
    header('Content-Length: ' . $link['file_size']);
    header('Content-Type: ' . $link['mime_type']);
    header('Content-Disposition: attachment; filename="' . $link['file_name'] . '"');
    $r = fopen(VAR_FILES . $p . $link['md5'], 'r');
    while (!feof($r)) {
        print fread($r, 1024);
        ob_flush();
    }
    fclose($r);
    if ($link['onetime'] == 'O') {
        jirafeau_delete_link($link_name);
    }
    exit;
} elseif (isset($_GET['get_capacity'])) {
    echo min(jirafeau_ini_to_bytes(ini_get('post_max_size')), jirafeau_ini_to_bytes(ini_get('upload_max_filesize')));
} elseif (isset($_GET['get_maximal_upload_size'])) {
    echo $cfg['maximal_upload_size'];
} elseif (isset($_GET['get_version'])) {
    echo JIRAFEAU_VERSION;
} elseif (isset($_GET['lang'])) {
    $l = $_GET['lang'];
    if ($l == "bash") {
        ?>
#!/bin/bash

# This script has been auto-generated by Jirafeau but you can still edit 
# options below.

# Config
proxy='' # ex: proxy='proxysever.test.com:3128' or set JIRAFEAU_PROXY global variable
Ejemplo n.º 2
0
/**
 * gets the maximum upload size according to php.ini
 * @returns the maximum upload size string
 */
function jirafeau_get_max_upload_size()
{
    return jirafeau_human_size(min(jirafeau_ini_to_bytes(ini_get('post_max_size')), jirafeau_ini_to_bytes(ini_get('upload_max_filesize'))));
}