将android base64上载到codeigniter

时间:2018-07-23 06:10:54

标签: java php android codeigniter

我可以将从Andoid上传的base64图像上传到Codeigniter吗?什么是最简单的代码?

这是我的代码,但不支持base64:

$config['upload_path'] = './asset/uspic/'; //On "userpic" upload
              $config['allowed_types'] = 'jpg|png'; //Jpg and Png Only
              $config['max_size'] = '2048'; //2MB
              $config['max_width']  = '2048'; //max width images
              $config['max_height']  = '2048'; //max height images
              $config['encrypt_name'] = TRUE;
              //$config['file_name'] = $prna; //set new Name
              $this->load->library('upload', $config); //load library upload
              $fnm = null;

              //Photos is detected OK
              if ($this->upload->do_upload('img')){
                //Get Filename
                $fnm = $this->upload->data('file_name');
                //Update user table on "Photo" column where Mail as ID
                $this->waterm->uptabusr(array('surel' => $mail), array('photo' => $fnm));
              }

0 个答案:

没有答案