=> * conversion. */ if (is_uploaded_file($input_filename)) { $tofile=fopen($temp_filename,"a"); $fromfile=fopen($input_filename,"r"); while (!feof($fromfile)){ $tempstring=fgets($fromfile,4096); // Bunch of stuff to change EOL to unix format. $tempstring=ereg_replace("\r\n?","\n",$tempstring); fwrite($tofile,$tempstring,4096); } } else { print ("The file I attempted to move was not the one you uploaded!\n"); return -1; } fwrite($tofile,"\n\n",256); chmod ($temp_filename,0664); unlink("$input_filename"); fclose($tofile); fclose($fromfile); return 0; } /* * This function deals with a file upload via the web. */ function addFile($name, $size, $type, $webtemp_filename) { if ($size> MAXFILESIZE) { print ("Specified file is larger than I will accept.
\n"); print("What are you trying to upload?"); return -3; } switch ($type) { case "text/plain": if (appendToday($name, $webtemp_filename)) { return -1; } break; default: /* Don't recognize the file type. */ return -2; break; } return 0; } /* * This function deals with new material submitted via the textarea form */ function addMaterial($text, $webtemp_filename) { /* Check size */ if (strlen($text)> MAXFILESIZE) { echo "The input text is larger than I will accept! What are you trying\n", "to write, a novel?"; return -3; } /* => conversion */ $text=ereg_replace("\r\n?","\n",$text); $text=stripslashes($text); /* Write the file */ $tofile=fopen("$webtemp_filename","a"); fwrite($tofile,$text,strlen($text)); fwrite($tofile,"\n\n",256); fclose($tofile); return 0; } ?>

Uploaded file