' . $uri . '

'; $server_output = curl_exec($session); // Let's do this! if (curl_getinfo($session, CURLINFO_HTTP_CODE) != 200) { echo '

' . $server_output . '

'; } else { echo '

' . (strlen($server_output) . ' bytes received') . '

'; // Tell me about the rabbits, George! } curl_close ($session); // Clean up //$download_url = ""; // From b2_authorize_account call $file_id = "4_z731245f41efc196b6dda0018_f116729ca6de74b38_d20190910_m132847_c002_v0001127_t0021"; // The ID of the file you want to download $uri = $download_url . "/b2api/v2/b2_download_file_by_id?fileId=" . $file_id . '&Authorization=' . $auth_token; $session = curl_init($uri); curl_setopt($session, CURLOPT_HTTPGET, true); // HTTP GET curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response echo '

' . $uri . '

'; $server_output = curl_exec($session); // Let's do this! if (curl_getinfo($session, CURLINFO_HTTP_CODE) != 200) { echo '

' . $server_output . '

'; } else { echo '

' . (strlen($server_output) . ' bytes received') . '

'; // Tell me about the rabbits, George! } curl_close ($session); // Clean up } function b2_download_file_by_name($download_url, $auth_token) { //$download_url = ""; // From b2_authorize_account call $bucket_name = "andysh-bt-test"; // The NAME of the bucket you want to download from $file_name = "B2-Test-Album/preview/7tgoy55do1vjv180ytlp.jpeg"; // The name of the file you want to download $uri = $download_url . "/file/" . $bucket_name . "/" . $file_name; $session = curl_init($uri); curl_setopt($session, CURLOPT_HTTPGET, true); // HTTP GET curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response echo '

' . $uri . '

'; $server_output = curl_exec($session); // Let's do this! if (curl_getinfo($session, CURLINFO_HTTP_CODE) != 200) { echo '

' . $server_output . '

'; } else { echo '

' . (strlen($server_output) . ' bytes received') . '

'; // Tell me about the rabbits, George! } curl_close ($session); // Clean up // You will need to use the account authorization token if your bucket's type is allPrivate. //$download_url = ""; // From b2_authorize_account call $bucket_name = "andysh-bt-test"; // The NAME of the bucket you want to download from $file_name = "B2-Test-Album/preview/7tgoy55do1vjv180ytlp.jpeg"; // The name of the file you want to download //$auth_token = ""; // From b2_authorize_account call $uri = $download_url . "/file/" . $bucket_name . "/" . $file_name . '?Authorization=' . $auth_token; $session = curl_init($uri); curl_setopt($session, CURLOPT_HTTPGET, true); // HTTP POST curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response echo '

' . $uri . '

'; $server_output = curl_exec($session); // Let's do this! if (curl_getinfo($session, CURLINFO_HTTP_CODE) != 200) { echo '

' . $server_output . '

'; } else { echo '

' . (strlen($server_output) . ' bytes received') . '

'; // Tell me about the rabbits, George! } curl_close ($session); // Clean up } ?>

b2_authorize_account

b2_download_file_by_name

downloadUrl, $authorize_account_result->authorizationToken); ?>

b2_download_file_by_id

downloadUrl, $authorize_account_result->authorizationToken); ?>