示例#1
0
        if ($hash != "") {
            $hash = strtoupper($hash);
            $sample = $share->get_sample($hash);
            if ($share->uri_compression != "") {
                $compressed_sample = $share->compress_file($sample);
                $encrypted = $share->encrypt_file($compressed_sample, $user->key_name);
                @unlink($compressed_sample);
            } else {
                $encrypted = $share->encrypt_file($sample, $user->key_name);
            }
            $contents = file_get_contents($encrypted);
            if ($share->verify_gpg($contents)) {
                $len = sprintf("%010d", filesize($encrypted));
                echo $len . $hash . $contents;
            } else {
                $share->send_error("Unable to encrypt file! {$loop} {$contents}", $hash);
            }
            @unlink($encrypted);
        }
    }
    die;
}
if ($share->uri_action == "getfile") {
    $hash = strtoupper($share->secure($_REQUEST[$share->uri_hash_type]));
    $sample = $share->get_sample($hash);
    if ($share->uri_compression != "") {
        $compressed_sample = $share->compress_file($sample);
        $encrypted = $share->encrypt_file($compressed_sample, $user->key_name);
        @unlink($compressed_sample);
    } else {
        $encrypted = $share->encrypt_file($sample, $user->key_name);