From: "Jenda Krynicky" <[EMAIL PROTECTED]>
To: "Edward G. Orton" <[EMAIL PROTECTED]>; "Perl-Win32-Web Mailing List"
<[EMAIL PROTECTED]>
Sent: Saturday, September 22, 2001 7:28 AM
Subject: Re: CGI::Lite
> > Has anybody noticed that you can't upload non-text files with
> > CGI::Lite? Anybody have a fix for it?
> >
> > Windows 2000 server (SP2)
> > ActivePerl build 628
> > CGI::Lite 2
>
> You mean ... text files are OK, binary files are corrupted (and a
> little longer than they should be), right?
>
> I don't have CGI::Lite by hand but you could fix it yourself.
> Look into the module and find the place where CGI::Lite saves the
> posted data to a temporary file. Then add
> binmode HANDLE;
> just after the open() statement.
>
> I don't think this will be that hard to find. Just look for "open".
>
> Jenda
>
> P.S.: Don't forget to send the fix to CGI::Lite author.
Jenda,
Thanks for the suggestion. I found the critical point where the file mode
needed to be addressed. For anyone who has similar problems, here's a patch.
It has been tested quite a bit (Unix and Windows 2000), but not as
thoroughly as some may like. A copy of this has been sent to the author to
deal with in whatever fashion is appropriate. Just out of curiosity, what's
the inverse of binmode()?
---------------Patch Lite.pm--------------
*** Lite.old Sat Sep 22 16:40:26 2001
--- Lite.pm Sat Sep 22 16:35:40 2001
***************
*** 1110,1115 ****
--- 1110,1116 ----
$$info =~ s/\015/$eol/og if ($platform ne 'Mac');
$$info =~ s/\012/$eol/og if ($platform ne 'Unix');
}
+ if (not($convert)) { binmode($handle); }
print $handle $$info;
--------------End Patch-----------------
ego
Edward G. Orton, GWN Consultants Inc.
Phone: 613-764-3186, Fax: 613-764-1721
email: [EMAIL PROTECTED]
----- Original Message -----
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web