php – $_FILES [‘file’] [‘name’]在codeigniter中

如何获取在codeigniter中上传文件文件名.我们将输入字段的值设为$this-> input-> post(‘name’),但是如何获取从表单上传文件名称

public function create(){

        //getting all the POST data in $data array
        $data = array('title' => $this->input->post('title'),'content' => $this->input->post('content'),'filename' => ?? HOW ??
        );
}

解决方法

1)确保你的表格是多部分的.使用帮助器form_open_multipart()

2)使用上传库接收文件

3)然后使用$this-> upload-> data()获得带有文件信息的数组

Here是如何和官方文档完整的

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...