Skip Menu |
 

This queue is for tickets about the libwww-perl CPAN distribution.

Report information
The Basics
Id: 7577
Status: resolved
Priority: 0/
Queue: libwww-perl

People
Owner: Nobody in particular
Requestors: a_kunysz [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 5.800
Fixed in: (no value)

Attachments


Subject: [HTTP::Request::Common] can't specify filename and headers when not uploading from file
Download (untitled) / with headers
text/plain 878b
The HTTP::Request::Common documentation is unclear on how to use the Form-based File Upload method without using a file (to upload content directly). After reading the source it turns out that if one choose to upload content directly it's impossible to specify file name and headers (content-type,...). Here is a patch against 1.23. I don't know if it's The Right Way(tm) to do it but it works and it doesn't seem to break anything while being as small as possible. If you choose not to include this patch in the next release, please at least make the documentation more accurate on how to do a RFC 1867-style upload without using a file. Here are informations asked on the form but I don't think it's relevant: libwww-perl 5.800-1 Perl v5.8.4 i386-linux-thread-multi Linux 2.4.26-1-k7 (all these things come from official Debian Sarge packages) Thanks, Adrien "Krunch" Kunysz
Download Common.pm.diff
text/x-diff 1.2k
1a2 > # $Id: Common.pm,v 1.24 2004/09/08 13:37:00 Adrien Kunysz Exp $ 142c143,144 < if ($file) { --- > local $SIG{'__WARN__'} = sub {}; # make stat() shut up > if (-r $file) { 160a163,165 > elsif ($file) { > $content = $file; > } 377,382c382,389 < This file will be read and its content placed in the request. The < routine will croak if the file can't be opened. Use an C<undef> as $file < value if you want to specify the content directly. The $filename is < the filename to report in the request. If this value is undefined, < then the basename of the $file will be used. You can specify an empty < string as $filename if you don't want any filename in the request. --- > This file will be read and its content placed in the request. If $file > isn't readable (! -r $file) it will be taken as the data to upload. > The routine will C<Croak> if the file is readable but can't be opened. > Use an C<undef> as $file value if you want to specify the content > directly. The $filename is the filename to report in the request. > If this value is undefined, then the basename of the $file will be > used. You can specify an empty string as $filename if you don't want > any filename in the request.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.