0

I am new to write web services for iOS and android applications in both applications they will upload an image from front end in base64 string format so come to android working fine but in iOS not working fine.I followed the following code plz suggest any one if any mistake.In the file path i am showing the data what iOS developer sent but how to show image preview instead of data?

        $image = base64_encode($image); //$image is base64 string sending from iOS       
        $output = $currentdate.'.jpeg';
        $destination_path = 'upload/'.$output;
        if(file_put_contents($destination_path , $image)){
        //$result = $output;

        $data = array ('imagename' => $currentdate);
        $where = array ('user_id=?' => $userid);
        try {
            $result = $db->update ( 'users', $data, $where );


            $result = $image;

        } catch ( Exception $ex ) {

            Zend_Controller_Action_HelperBroker::getStaticHelper('FurrekaLogHelper')->throwError('SQL ERROR: ' . print_r($e, true));
        }

0 Answers0