';
continue;
}
$crc = (($_POST['crc_mode'][$i] == 'hash_file' && function_exists('hash_file')) ? strtoupper(hash_file('crc32b', $file['name'])) : '111111');
echo "Started to split file $dest_name parts of " . bytesToKbOrMbOrGb($partSize) . ", Using Method - Total Commander... ";
echo "Total Parts: $totalParts
";
for($j = 1; $j <= $totalParts; $j++) {
if (file_exists("$saveTo$dest_name." . sprintf('%03d', $j))) {
echo "It is not possible to split the file. A piece already exists $dest_name." . sprintf('%03d', $j) . ' !
';
continue 2;
}
}
if (file_exists("$saveTo$dest_name.crc")) echo "It is not possible to split the file. CRC file already exists $dest_name.crc !
";
elseif (!is_file($file['name'])) echo "It is not possible to split the file. Source file not found {$file['name']} !
";
elseif (!is_dir($saveTo)) echo "It is not possible to split the file. Directory doesn't exist$saveTo !
";
elseif (!@write_file("$saveTo$dest_name.crc", "filename=$dest_name\r\nsize=$fileSize\r\ncrc32=$crc\r\n")) echo "It is not possible to split the file. CRC Error$dest_name.crc" . " !
";
else {
$time = filemtime("$saveTo$dest_name.crc");
while (isset($list[$time])) $time++;
$list[$time] = array('name' => realpath("$saveTo$dest_name.crc"), 'size' => bytesToKbOrMbOrGb(filesize("$saveTo$dest_name.crc")), 'date' => $time);
$split_buffer_size = 2097152;
$split_source = @fopen($file['name'], 'rb');
if (!$split_source) {
echo "It is not possible to open source file {$file['name']} !