博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
雷林鹏分享:CodeIgniter文件上传错误:the filetype you are attempting to upload is not allowed...
阅读量:6947 次
发布时间:2019-06-27

本文共 746 字,大约阅读时间需要 2 分钟。

  CodeIgniter文件上传错误:the filetype you are attempting to upload is not allowed

  在本地lnmp测试环境文件上传成功,代码移至到生成环境后,提示 the filetype you are attempting to upload is not allowed 错误,谷歌了N久才找到解决方法。

  网络上有说出现 the filetype you are attempting to upload is not allowed 错误的可能原因:

  1、重命名导致,去除重命名配置项

  2、重名不带后缀

  .....

  最终解决方法:

  修改前:

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

  修改后:

  $config['allowed_types'] = '*';

  最终上传配置项:

  $config['upload_path'] = $save_path;

  $config['allowed_types'] = '*';

  $config['file_name'] = "{$userid}.png";

  $config['overwrite'] = true;

  $this->load->library('upload', $config);

  通过把允许上传类型改为 * ,这样可能会存在一些安全问题。

  文章转载自 [http://www.php230.com]

  (编辑:雷林鹏 来源:网络 侵删)

转载于:https://www.cnblogs.com/linpeng1/p/10819367.html

你可能感兴趣的文章
Eclipse设置Tab键为四个空格
查看>>
Windows漏洞利用技术概述
查看>>
多态与接口
查看>>
HTML5标准学习 - 文档结构
查看>>
zookeeper练习
查看>>
最短路径
查看>>
手机评测
查看>>
java ssm 后台框架平台 项目源码 websocket 即时通讯 IM quartz springmvc
查看>>
我的小爬虫—cocoa 中的正则表达式
查看>>
HTML5 中 div 和section以及 article 的不同之处
查看>>
Yii2学习笔记之场景
查看>>
CS Website
查看>>
docker - 容器里安装ssh
查看>>
Ant design 组件开发
查看>>
完整性约束
查看>>
docker 17.09.0-ce 启动更换网络地址
查看>>
关于《大道至简》第六章的收获
查看>>
JavaWeb部分面试题
查看>>
mac osx 系统开发php 的一些工具
查看>>
Tcp的三次握手,以及原理详解
查看>>