i need your help please and i haven't found some answers for my problem.
I want to take a picture (or take it from the gallery) on the iphone/ipad and then encode the picture to a base64 string with php and send the base64 string to a webservice.
If i try it on the pc, everything is alright. if i want to do this on the ipad, it seems like nothing or a incorrect base64 string is send to the webservice but i 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 this didn't work on ipad/iphone?
i hope anybody could help me.