<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hi all,<br><br>I am trying to create a function that allows me to send binary files from a client and have the server write it into a directory.<br>I have it working right now, but it errors when I try to send a file greater then about 300 Kb. Any file under that size will<br>transfer just fine.<br><br><br><br>Here is the function I have on the server...<br><br>function upload_file2($m)<br>{<br> $param1 = $m->getParam(0);<br> $write_file = $param1->scalarval();<br> $convert_file = fopen($write_file, "rb");<br><br> $param2 = $m->getParam(1);<br> $file_name = $param2->scalarval();<br><br> $test_write = fopen("/tmp/".$file_name, "w");<br> fwrite($test_write, $write_file);<br> fclose($test_write);<br><br> return new xmlrpcresp(new xmlrpcval($file_name));<br>}<br><br>$upload_file2_sig = array(array($xmlrpcBase64,$xmlrpcBase64, $xmlrpcString));<br>$upload_file2_doc = 'uploads a binary file';<br><br><br><br>I am using a Python client to send the file. I was playing around with a Python server to transfer files and the Python<br>server does not run into any problems with file size.<br><br>This is what I have on the python client...<br><br>import xmlrpclib<br><br>print("Trying to connect...")<br>server_url = 'http://some_url/new_server.php';<br>server = xmlrpclib.Server(server_url);<br><br>handle = open("nova.bmp")<br>file_name = "fetch_nova.bmp"<br>send_file = server.sendFile(xmlrpclib.Binary(handle.read()), file_name)<br><br><br>This is the error I get when trying to use the Python Client/Php Server combo<br><br>Trying to connect...<br>Traceback (most recent call last):<br> File "testProc_client.py", line 20, in ?<br> send_file = server.sendFile(xmlrpclib.Binary(handle.read()), file_name)<br> File "/usr/lib/python2.3/xmlrpclib.py", line 1029, in __call__<br> return self.__send(self.__name, args)<br> File "/usr/lib/python2.3/xmlrpclib.py", line 1316, in __request<br> verbose=self.__verbose<br> File "/usr/lib/python2.3/xmlrpclib.py", line 1070, in request<br> headers<br>xmlrpclib.ProtocolError: <ProtocolError for mmodev.jpl.nasa.gov/frank/xmlrpc/demo/server/new_server.php: -1 ><br><br><br>Any help would be greatly appreciated.<br>Thanks!<br><br>-Frank<br><br><br /><hr />Windows Live™ Hotmail®:…more than just e-mail. <a href='http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_hm_justgotbetter_explore_012009' target='_new'>Check it out.</a></body>
</html>