Добрый вечер прошу помочь разобраться спроблемой , сейчас изображения сохраняются в base64 формате при добавлении поста , мне нужно от этого избавиться так как переношу бд с другого движка
есть php связанный с добавлением изображения в пост
if (!can_post_to_feed($entity_type, $entity_id, $to_user_id)) return json_encode($result);
//check for images and videos upload
$imagesFile = input_file('image');
$imageToUpdate = false;
if (!$auto_post and $imagesFile and user_has_permission('can-upload-photo-feed')) {
$images = array();
$validate = new Uploader(null, 'image', $imagesFile);
if ($validate->passed()) {
foreach($imagesFile as $im) {
$uploader = new Uploader($im);
$path = get_userid().'/'.date('Y').'/photos/posts/';
$uploader->setPath($path);
if ($uploader->passed()) {
$image = $uploader->noThumbnails()->resize()->toDB($entity_type.'-posts', $entity_id, $privacy)->result();
$images[$uploader->insertedId] = $image;
} else {
$result['status'] = 0;
$result['message'] = $uploader->getError();
return json_encode($result);
}
}
} else {
$result['status'] = 0;
$result['message'] = $validate->getError();
return json_encode($result);
}
if (!empty($images)) {
if (count($images) == 1) {
foreach($images as $imgId => $p) {
$imageToUpdate = $imgId;
}
}
$images = perfectSerialize($images);
}
}
$feed = db()->query("INSERT INTO `feeds` (is_poll,feeling_data,to_user_id,link_details,can_share,user_id,files,tags,entity_id,entity_type,type,type_id,type_data,photos{$music_colum_sql},video,feed_content,privacy,location,time) VALUES(
'{$poll}','{$feeling}','{$to_user_id}','{$link_details}','{$can_share}','{$userid}','{$files}','{$tagsData}','{$entity_id}','{$entity_type}','{$type}','{$type_id}','{$type_data}','{$images}'{$music_value_sql},'{$video}', '{$content}', '{$privacy}', '{$location}', '{$time}'
)");
if ($feed) {
session_put(md5($type.$type_id), time());
if (!$auto_post) {
session_put(md5('feed'), time());
session_put(md5('timeline'.get_userid()), time());
}
$feed_id = db()->insert_id;
if (!empty($images)) {
$images = perfectUnserialize($images);
if (count($images) == 1) {
foreach($images as $imgId => $p) {
db()->query("UPDATE medias SET ref_id='{$feed_id}',ref_name='feed' WHERE id='{$imgId}'");
}
}
}