if ( ! $this->upload->do_upload('course_profile_image'))
{
error($this->upload->display_errors(),TRUE,400);
}else{
$data = array('upload_data' => $this->upload->data());
$filename=$data['upload_data']['file_name'];
$pathinfo = 'dist/img/courseimage/'.$filename;
$filetype = pathinfo($pathinfo, PATHINFO_EXTENSION);
$filecontent = file_get_contents($pathinfo);
try{
$base64=rtrim(base64_encode($filecontent));
}catch(Exception $e){
error($e,TRUE,855);
}
$image = 'data: '.mime_content_type($pathinfo).';base64,'.$base64;
It's converting the image into the base64 but when large dimensions images uploaded it covets only half or some part of it. I am storing this base64 in to mysql database column type text.
将您的数据库字段类型从text更改为mediumText,因为TEXT只有64 KiB的长度,因此它不存储您的完整基础64代码。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.