小编Kal*_*ski的帖子

Codeigniter - 获取上传的文件名

如何将上传的文件名保存在变量中(我是CI新手)?

我正在使用此代码进行测试:

我真的很感谢你对这些家伙的帮助.

这是我正在使用的代码(由于stackoverflow的限制,我一遍又一遍地输入这个代码):

<?php

class Gallery_model extends CI_Model {

    var $gallery_path;
    var $videos_path;
    var $thumbnail;
    var $video_name;

    function Gallery_model() {

        parent::__construct();

        $this->gallery_path = realpath(APPPATH . '../images');
        $this->videos_path = realpath(APPPATH . '../videos');
        $this->videos_path_tnumb = realpath(APPPATH . '../videos/thumb');

        $this->thumbnail = 'C://xampp//htdocs//upload//videos//thumb';
        $this->video_name = 'C://xampp//htdocs//upload//videos//79825_00_01_SC03_intro.mov';
    }

    function do_upload() {

        $config = array(
//            'allowed_types' => 'jpg|jpeg|png|gif',
//            'upload_path' => $this->gallery_path,
//            'max_size' => 10000

            'allowed_types' => 'avi|mp4|flw|mov',
            'upload_path' => $this->videos_path
        );

        $this->load->library('upload', $config);
        $field_name = "some_field_name";
        if ($this->upload->do_upload()) {
            $this->getThumbImage($_POST['userfile']);
        }
    } …
Run Code Online (Sandbox Code Playgroud)

php codeigniter

11
推荐指数
1
解决办法
4万
查看次数

标签 统计

codeigniter ×1

php ×1