use*_*104 12 html php jquery codeigniter
这是我用于上传图像的代码.
$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));
}
Run Code Online (Sandbox Code Playgroud)
而前端只是一个
<input type = 'file' >
Run Code Online (Sandbox Code Playgroud)
问题是,由于图片上传应该是视频缩略图,我该怎么做才能实现上传?例如在前端使用插件来限制/裁剪(任何推荐)
另外,在服务器端我该如何查看?
maintain_ratio
Run Code Online (Sandbox Code Playgroud)
它是您保持比例的偏好
Specifies whether to maintain the original aspect ratio when resizing or use hard values.
Run Code Online (Sandbox Code Playgroud)
更多细节