Jared Hess wrote:
> 
> Bill thanks for the help. Unfortunately, after adding Binmode to my code (I
> think I did it right), I still can't get it to work. Does anyone have any
> other ideas?
> 
> The current state of my script is located here:
> http://www.inconnect.com/~jhess/cgi-bin/scriptupload.cgi
> 
> My somewhat convoluted code to upload .ZIP files is located here:
> http://www.inconnect.com/~jhess/cgi-bin/scriptupload.txt
> 
> Could someone please give my script a shot, take a look at my code and tell
> me what I'm doing wrong? I've tried everything I know (as much as I can for
> a Perl newbie).

You only need one binmode per file and it should go before the first read/write.

Change:

open (SAVEFILE, ">$savedir$file") || dienice("Can't open filehandle: $!\n");

  while (read($fullfile, $buffer, 1024)) {
    binmode SAVEFILE;
    print SAVEFILE $buffer;
    binmode SAVEFILE;
  }

To:

binmode $fullfile;
open (SAVEFILE, ">$savedir$file") || dienice("Can't open filehandle: $!\n");
binmode SAVEFILE;
  while (read($fullfile, $buffer, 1024)) {
    print SAVEFILE $buffer;
  }
-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   http://www.todbe.com/
  / ) /--<  o // //      Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to