I want to download a large holly file with PHP, but due to the use of shared hosting, sometimes I encounter a TIMEOUT error and the file download remains incomplete, I want if the download is stopped for any reason and the script again I called the file to start downloading from the last point where the download was stopped and join the previous file, however I do not want the file to be defective after the download is complete.
My simple code:
<؟php
set_time_limit(0);
file_put_contents("Solidworks.Premium_2021_SP1_Windows.part1.rar", fopen("https://dl1.wikishare.ir/sdlftpuser02/Category99/Engineering/Solidworks/Solidworks.Premium_2021_SP1_Windows.part1.rar", 'r'));
?>
Any guidance and help will be greatly appreciated.