randyk 2004/07/04 12:41:13
Modified: . FAQ.pod Log: add an item about using APR::PerlIO to open $upload->tempname on Win32, rather than use of Perl's open(). Revision Changes Path 1.3 +14 -1 httpd-apreq-2/FAQ.pod Index: FAQ.pod =================================================================== RCS file: /home/cvs/httpd-apreq-2/FAQ.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- FAQ.pod 2 Jul 2004 15:23:14 -0000 1.2 +++ FAQ.pod 4 Jul 2004 19:41:13 -0000 1.3 @@ -23,11 +23,24 @@ We recommend using (1), and falling back to (2) until you get (1) working. - =head2 When I try to upload a file, why do I get this error "[error] Can't locate .../Apache/Request/upload.al in @INC"? I<Apache::Upload> is now a separate module in apreq2, so you need to C<use Apache::Upload> to load the C<Apache::Request::upload> function. + + +=head2 On Win32, I can't open an uploaded file specified by $upload-E<gt>tempname + +C<tempname> in libapreq2 enables a flag that will delete the temporary +file after it's closed. On Win32, however, use of Perl's C<open()> +to open this file causes a premature deletion. Use instead the +APR::PerlIO layer to open this file: + + use APR::PerlIO; + ... + my $name = $upload->tempname; + open my $fh, "<:APR", $name, $upload->pool or die "Can't open $name: $!"; + ... =head1 Using libapreq2 outside of Apache.
