|more useful options|
CGI Upload with OLD CGI.pmby amelinda (Friar)
|on Oct 17, 2001 at 22:16 UTC||Need Help??|
amelinda has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to write a CGI that accepts a file upload. I'm about to go totally nuts. Some helpful help would be appreciated.
Why am I going nuts, you ask? Why not use CGI.pm's handy upload() feature? Simple. That feature doesn't start until 2.47. I get 2.36. Before anyone says "install the new version" or "get them to install the new version" or even "install the new version in your directory": I can't. I've already asked the sysadmin to install it, but can't wait that long. I only have FTP access, so I'm not sure how to install through FTP. Thus, my request for some helpful help.
So, this is the code I have.
This is the minim case, and it fails. Why? I have no idea. Apparently, I don't get CGI::Carp, either.
The undef $/; and tr bits are there for nasty file conversion issues.
Basically what seems to be happening is that @buffer is not global, so I can't see it outside that no strict; block. So I tried to put in, before that block, a my @buffer; line. That fails too.
I thought about trying to wade through CGI.pm and cut-n-pasting some code, but I'm kind of in a time crunch, and this almost works. :sigh: