Here is the code I used for uploading an image.
$this->load->library('upload');
$ext = pathinfo($file_name, PATHINFO_EXTENSION);
$img_name = now() . "." . $ext;
$imgConfig['upload_path'] = $this->image_path;
$imgConfig['file_name'] = $img_name;
$imgConfig['max_size'] = '2048';
$imgConfig['allowed_types'] = 'jpg|png|bmp';
$imgConfig['overwrite'] = FALSE;
$this->upload->initialize($imgConfig);
if ($this->upload->do_upload("image_url")) {
$this->Playlist_model->update_playlist($insert_id, array("image_url" => $img_name));
}
And the frontend is simply a
<input type = 'file' >
The problem is , as the image upload should be an video thumbnail, what should I do to implement the upload? e.g using plugin in frontend to restrict/ crop (any recommendation)
Also, in server side how can I check?