[Jifty-commit] r5993 - Net-Jifty/trunk/lib/Net

Jifty commits jifty-commit at lists.jifty.org
Mon Nov 17 09:36:34 EST 2008


Author: ruz
Date: Mon Nov 17 09:36:34 2008
New Revision: 5993

Modified:
   Net-Jifty/trunk/lib/Net/Jifty.pm

Log:
* use new method to support file uploads 

Modified: Net-Jifty/trunk/lib/Net/Jifty.pm
==============================================================================
--- Net-Jifty/trunk/lib/Net/Jifty.pm	(original)
+++ Net-Jifty/trunk/lib/Net/Jifty.pm	Mon Nov 17 09:36:34 2008
@@ -270,9 +270,13 @@
         );
 
         if (@args) {
-            my $content = $self->form_url_encoded_args(@args);
-            $req->header('Content-type' => 'application/x-www-form-urlencoded');
-            $req->content($content);
+            if ( grep ref $_, @args ) {
+                $req->header('Content-type' => 'multipart/form-data');
+                $req->add_part( $_ ) foreach $self->form_form_data_args(@args);
+            } else {
+                $req->header('Content-type' => 'application/x-www-form-urlencoded');
+                $req->content( $self->form_url_encoded_args(@args) );
+            }
         }
 
         $res = $self->ua->request($req);


More information about the Jifty-commit mailing list