Using Default Apikey.
\n"; } if (!$cantlogin && !empty($upload_acc['filecloud_io']['user']) && !empty($upload_acc['filecloud_io']['pass'])) { $_REQUEST['up_uselogin'] = 'yes'; $_REQUEST['up_login'] = $upload_acc['filecloud_io']['user']; $_REQUEST['up_pass'] = $upload_acc['filecloud_io']['pass']; $_REQUEST['action'] = 'FORM'; echo "Using Default Login.
\n"; } if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up=true; else { echo "\n"; echo "\n"; } if ($continue_up) { $not_done = $uselogin = false; $login = true; if ($fsize < 5120) html_error('The file is too small for upload.'); // They don't accept files under 5 KB :D // Ping api $page = geturl ('api.filecloud.io', 80, '/api-ping.api');is_page($page); is_notpresent($page, '"message":"pong"', 'Error: filecloud.io api is down?.'); // Login if (!empty($_REQUEST['up_uselogin']) && $_REQUEST['up_uselogin'] == 'yes' && !empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { echo "\n| \n\n Retrive upload ID \n";
$page = geturl('api.filecloud.io', 80, '/api-fetch_upload_url.api?response=text', '', 0, array('akey' => $_REQUEST['up_apikey']));is_page($page);
is_present($page, 'status: error', 'Upload Failed: "'.htmlentities(cut_str($page, 'message: ', "\n")).'"');
if (!preg_match('@upload_url: http://(s\d+\.filecloud\.io)(/[^\r|\n]+)@i', $page, $loc)) html_error('Upload server not found.', 0);
$post = array();
if ($login) $post['akey'] = $_REQUEST['up_apikey'];
$up_loc = "http://{$loc[1]}{$loc[2]}?response=text";
// Uploading
echo "\n";
$url = parse_url($up_loc);
$upfiles = upfile($url['host'], !empty($url['port']) ? $url['port'] : 80, $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), '', 0, $post, $lfile, $lname, 'Filedata');
// Upload Finished
echo "";
is_page($upfiles);
is_present($upfiles, 'status: error', 'Upload Error: "'.htmlentities(cut_str($upfiles, 'message: ',"\n")).'"');
if (preg_match('@ukey: (\w+)@i', $upfiles, $dl)) {
$download_link = 'http://filecloud.io/'.$dl[1];
if(preg_match('@name: ([^\r|\n]+)@i', $upfiles, $fn)) $download_link .= '/' . $fn[1];
if ($uselogin) echo "\n
|