codeigniter 上传 3gp 或 mp4 文件不起作用
您好,我正在尝试在代码点火器上上传 3gp 和 mp4 文件,但它不起作用,
使用相同的代码可以很好地上传 mpg 文件,任何人都可以帮助我,我真的很感激,
这是我正在使用的代码
$config = array(
'allowed_types' => 'mp4|mp4|3gp|mpg';
'file_name' => 'video',
'max_size' => 1000,
'upload_path' => realpath(APPPATH.'../user_uploads/'),
);
$this->load->library('upload',$config);
$this->upload->do_upload();
$user_upload = $this->upload->data();
hi I am trying to upload 3gp and mp4 files on code igniter and it doesnt work
the mpg files are uploaded fine using the same code could anyone help me with that I will really appreciate that
Here is the code i am using
$config = array(
'allowed_types' => 'mp4|mp4|3gp|mpg';
'file_name' => 'video',
'max_size' => 1000,
'upload_path' => realpath(APPPATH.'../user_uploads/'),
);
$this->load->library('upload',$config);
$this->upload->do_upload();
$user_upload = $this->upload->data();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只需在 config/mimes.php 文件中添加您的 mime 类型即可。就像 3gp 一样:
可用的 mime 类型列表: http ://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
Just add your mime type in the config/mimes.php file. Like for 3gp:
List of available mime types : http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
application/config/mimes.php
application/config/mimes.php
在以下文件
application/config/mimes.php的
$mimes
数组中添加 .3gp 的 mime 类型add mime type for .3gp in
$mimes
array in below filesapplication/config/mimes.php
您必须设置允许上传的文件类型
,并且如果您在 upload cofig 中输入的 mime 类型在
/config/mimes.php
中不存在。也将其添加到那里You have to set the allowed types of files which can be uploaded
and if the mime type you put in upload cofig doesn't exist in
/config/mimes.php
. add it there also