I'm trying to get CGI->upload() to work with our IIS5 server (and no, we can't just use Apache as we require NTLM authentication), yet it doesn't appear to want to work
The source is pretty much identical to example 5.2 from O'Reilly's CGI programming with Perl, but I've included my bastardised version below:
# No Errors detected
# Deal with the uploaded file
my $filename = $request->param('file');
my $filehandle = $request->upload( $filename );
while( $filename =~ s/(.+)\\(.+)/$2/gi ) {}
unless( $request->cgi_error )
{
# No errors so far
if( open( FILE, "c:\\temp\\$filename" ) )
{
binmode( FILE );
binmode( $filehandle );
while( read( $filehandle, $buffer, BUFFER_SIZE ) ) { print FIL
+E $buffer; }
$shorttitle = "Success : Upload :";
}
}
It appears that $filehandle is undefined...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.