上传文件类型 [英] Upload file type

查看:110
本文介绍了上传文件类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个上传文件,它不会保存在数据库中。我创建了控制器和视图像codeigniter教程说。

I've created an upload file and it won't save in database. I created the controller and the view like codeigniter tutorial says.

我把配置的allowed_types。

I put in the config the allowed_types.

 $config['allowed_types'] = 'gif|jpg|png|jpeg';

并继续向我显示:

 The filetype you are attempting to upload is not allowed.

我该怎么办?

推荐答案

将此系统/ libraries / Upload.php替换为:

Replace your system/libraries/Upload.php with this one:

https://raw.github.com/narfbg/CodeIgniter/320ddaa3d01c9d8ee6832fa25f9273e2588c63dd/system/libraries/Upload.php

这是一个新版本的Upload类,目前正在等待合并 - 它应该解决您上传文件检测时可能遇到的任何问题。

This is a new version of the Upload class that's currently waiting to be merged - it should fix any issue that you might have with file detection on upload.

这篇关于上传文件类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆