To make it simple:
Hope someone with more experience can help because I have tried 2 days on this an nothing.
For now I only have the CURL function that is working good:
$curl = curl_init();
curl_setopt( $curl, CURLOPT_URL, $urltoget );
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0 );
curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, 0 );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true );
$tempsavefile = curl_exec( $curl );
curl_close( $curl );