Quote Originally Posted by soft2050 View Post
Try this code:

PHP Code: 
function upNetLoad($value$usr$pass){
// Soft2050
$filename basename($value);

$url file_get_contents('http://api.netload.in/getserver.php');
$post = Array ('modus' => 'file_upload''auth' => '' 'user_id' => $usr 'user_password' => $pass);

$ch curl_init();
curl_setopt($chCURLOPT_URL$url);
curl_setopt($chCURLOPT_POST1);
curl_setopt($chCURLOPT_POSTFIELDS$post);
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
$result curl_exec ($ch);
curl_close ($ch);

if (
preg_match("/upload_failed/"$result) || preg_match("/prepare_failed/"$result)) {
    return 
'Upload failed.';
}
else if (
preg_match("/UPLOAD_OK/"$result)) {
    
$arr explode(';'$result);
    
/*
    $arr[0] : UPLOAD_OK
    $arr[1] : FILENAME
    $arr[2] : FILESIZE
    $arr[3] : DOWNLOAD LINK
    $arr[4] : DELETE LINK
    */
    
return $arr[3];
}


Usage example:
PHP Code: 
echo upNetLoad(realpath('file.rar'), 'user''password'); 

thanks...i love you...but somwthings not work

i retry tonight...
ciaociao4 Reviewed by ciaociao4 on . netload upload script :D i use a script to upload on the filehost...like fileserve filesonic etc..etc... now i need to convert to allow the upload to netload... netload have api but i dont know how use this... Rating: 5