$uploadpath = "newsletters/"; # Fullpath comes from file specified in the form $file = $fullpath; $file=~s/^.*(\\|\/)//; # STRIP PATHWAY OFF! # binmode $fullfile; $file = lc($file); #print "

Testing...file is: $file"; $buffer = ''; #print "

Testing...uploadpath is: $uploadpath"; #print "

Testing...Filehandle is: $uploadpath" . "$file"; # Open the file for reading open (IN,$fullpath) || dienice("Couldn't open file ** $fullpath ** for reading: $!"); # Open the directory for writing to open (SAVEFILE, ">$uploadpath"."$file") || dienice("Can't open filehandle: $uploadpath" . "$file $!\n"); binmode SAVEFILE; $i=0; while ($bytes = read(IN, $buffer, 1024)) { $bytesread += $bytes; print SAVEFILE $buffer; } close(SAVEFILE) || dienice ("Can't close filehandle: $uploadpath/$file $!\n"); close (IN);