I was able to figure it out. If anyone is interested here is the code to take a file and split it into equal parts. It also creates a .bat file so that you can then rejoin the parts.
<pre>
<?
$filename = "C:\apache\htdocs\test.zip";
$maxfilesize = 1000000;
$com = "copy /b "; // Command string for the batch file
$pos = 0; //current position of the file pointer
$i = 1;
if (!($fp = fopen ($filename, "r"))) {
print "Error - could not open the file $filename";
}
else {
$filesize = filesize($filename);
$sizesplit = ceil($filesize / $maxfilesize); //echo $sizesplit;
$size = $filesize / $sizesplit; //echo $size;
$pos = $size;
for(; $i <= $sizesplit; $i++){
echo "fp = ";
echo ftell($fp);
if($i==$sizesplit){
$pos += $size;
$com = "$com $filename.$i";
}
else
$com = "$com $filename.$i + ";
$byte = fread ($fp, $pos);
echo "<BR>pos = $pos <BR>i = $i<BR>size = $size<BR>*************<BR>";
if (!($fp1 = fopen ("$filename.$i", "w+"))) {
print "Error - could not open the file $filename.$i";
}
else {
fputs($fp1,$byte);
fclose ($fp1);
}
}
fclose ($fp);
$com = "$com $filename";
if (!($fp = fopen ("$filename(join).bat", "w+"))) {
print "Error - could not open the file $batname";
}
else {
fputs($fp,$com);
fclose ($fp);
}
}
echo "<br>done";
?>
</pre>