note 66230 added to ref.xmlrpc

From: Date: Wed, 17 May 2006 09:16:44 +0000
Subject: note 66230 added to ref.xmlrpc
Groups: php.notes 
Request: Send a blank email to php-notes+get-111481@lists.php.net to get a copy of this message
for others attempting the same thing, here is what a function would look like if you wanted to send a base64 encoded file from a client and then save it onto the server. the other code necessary to call this function via an RPC is available in other comments so i won't repeat it. parameters: 1 - name of file 2 - base64 encoded data of file note the use of $file_data->scalar <? function sendFile($method_name, $params, $user_data) { $file = "/somedir/" . $params[0]; $file_data = $params[1]; $fh = @fopen($file, "wb"); if ($fh) { if (@fwrite($fh, $file_data->scalar)) { $msg = "success msg"; } else { $msg = "couldn't write to file"; } fclose($fh); return $msg; } else { return "couldn't open file"; } } ?> ---- Server IP: 216.194.113.175 Probable Submitter: 68.11.244.125 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/ref.xmlrpc.php Edit -- http://master.php.net/note/edit/66230 Del: integrated -- http://master.php.net/note/delete/66230/integrated Del: useless -- http://master.php.net/note/delete/66230/useless Del: bad code -- http://master.php.net/note/delete/66230/bad+code Del: spam -- http://master.php.net/note/delete/66230/spam Del: non-english -- http://master.php.net/note/delete/66230/non-english Del: in docs -- http://master.php.net/note/delete/66230/in+docs Del: other reasons-- http://master.php.net/note/delete/66230 Reject -- http://master.php.net/note/reject/66230 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#111481) next »