CodeIgniter You did not select a file to upload
2014-09-10来源:易贤网

在php框架CI2以上版本做php框架上传文件时,出现了You did not select a fileto upload,这样的上传错误提示,单在实际上传中已经选择了文件。

解决方法。

1.首先确定自己的form提交 有enctype="multipart/form-data"配置

2.提交的file表单name比如为upfilename,那么你在controllers中获取的时候也要用该名称$this->upload->do_upload("upfilename")

这两个保持一致。

这样就不会出现You did not select a file to upload找不到上传文件的情况了。

当上传中文名称文件的时候出现

A problem was encountered while attempting to move the uploaded file tothe final destination.

这个错误提示,原因就中文名称,将中文更改为其他字母数字等即可。

更多信息请查看IT技术专栏

2026公务员·事业单位培训课程试听报名

  • 报班类型
  • 姓名
  • 手机号
  • 验证码
推荐信息