Don't forget; you can use copy on remote files, rather than doing messy fopen stuff.  e.g.

<?php
if(!@copy('https://ultracad.ir/backup-ultracad_multidomain_2026-06-17-13-04-01.tar.gz','./backup-ultracad_multidomain_2026-06-17-13-04-01.tar.gz'))
{
    $errors= error_get_last();
    echo "COPY ERROR: ".$errors['type'];
    echo "<br />\n".$errors['message'];
} else {
    echo "File copied from remote!";
}
?>