--- C:/Users/andre/AppData/Local/Temp/TCV9242.tmp/json_server.1.8.2.1.module Sun Jan 13 12:12:23 2008 +++ C:/www/drupal/contributions/modules/json_server/json_server.module Fri Jul 11 13:48:29 2008 @@ -16,7 +16,6 @@ if (!isset($_POST)) { return "JSON server accepts POST requests only."; } - $request = $_POST['method']; $methods = services_get_all(); $args = array(); @@ -26,6 +25,20 @@ unset($_POST['method']); $args = array(); foreach($method['#args'] as $arg) { + + //If the argument type is defined as binary a matching name argument + //should not exist in $_POST. The matching name argument should instead + //be found in the $_FILES superglobal + if ($arg['#type'] == 'binary') { + if(isset($_POST[$arg['#name']])) { + return drupal_to_js(array("status" => FALSE, "data" => "Argument ". $arg['#name'] ." is not of expected type binary")); + } + elseif(isset($_FILES[$arg['#name']])) { + $args[] = $arg['#name']; + continue; + } + } + if(isset($_POST[$arg['#name']])) { $args[] = $_POST[$arg['#name']]; }