php base64 iphone picture to webservice -
i need please , haven't found answers problem.
i want take picture (or take gallery) on iphone/ipad , encode picture base64 string php , send base64 string webservice.
if try on pc, alright. if want on ipad, seems nothing or incorrect base64 string send webservice have no idea why or so?!
picture.php
<form action="picture.php?action=upload" method="post" enctype="multipart/form-data"> <input type="file" name="datei" accept="capture=camcorder"> <br/><br/> <input type="submit" value="up"> </form> <? if(isset($_get['action'])) { $tmp_name = $_files["datei"]["tmp_name"]; $name = $_files["datei"]["name"]; $name = substr($name,0,-4); $name.="_".time().".jpg"; move_uploaded_file($tmp_name, "upload/".$name); $content = file_get_contents ( "upload/".$name ); $imagebase = base64_encode( $content ); $success = savepicture($imagebase); }
function savepicture()
function savepicture($pic_base64) { ini_set("soap.wsdl_cache_enabled", "0"); $pageurl = 'http://....'; $page = new ntlmsoapclient($pageurl); $params = array("precordid" => "1", "pfieldid" => 70000, "puserid" => "153", "pcontent" => $pic_base64 ); $result = $page->setblobvalue($params); if($result->return_value != "error") { return true; } else { return false; } }
any ideas why didn't work on ipad/iphone?
i hope me.
i think iphone/ipad has problems capture=camcorder
.
please try this:
<input type="file" name="datei" accept="image/*;capture=camera">
instead of
<input type="file" name="datei" accept="capture=camcorder">
for more information check this:
Comments
Post a Comment