我如何在Codeigniter中上传超过50MB的mp4视频? [英] How i can upload more than 50MB mp4 videos in codeigniter?

查看:132
本文介绍了我如何在Codeigniter中上传超过50MB的mp4视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用下面的代码,我增加了一个最大大小,但是它仅上传1或2 mb的视频,如果我上传了55 MB的视频,则需要花费很长时间来处理,但结果显示为空白页面:

Am using below code, I have added a maximum size, but it uploads only 1 or 2 mb videos, if i upload a 55 MB video, it takes long to process but shows a result as blank page:

 if (isset($_FILES['video']['name']) && $_FILES['video']['name'] != '') {
            unset($config);
            $date = date("ymd");
            $configVideo['upload_path'] = './videos';
            $configVideo['max_size'] = '602400000';
            $configVideo['allowed_types'] = 'mp4|avi|flv|wmv|';
            $configVideo['overwrite'] = FALSE;
            $configVideo['remove_spaces'] = TRUE;
            $video_name = $date.$_FILES['video']['name'];
            $configVideo['file_name'] = $video_name;

            $this->load->library('upload', $configVideo);
            $this->upload->initialize($configVideo);
            if (!$this->upload->do_upload('video')) {
                echo $this->upload->display_errors();
            } else {
                $videoDetails = $this->upload->data();

             $schdate = $this->input->post('scheduledate');

                $schdesc = $this->input->post('scheduledes');

                $user = '1';

                $data = array(

                    'name' =>$configVideo['file_name'],

                    'date' => $schdate,

                    'description' => $schdesc,

                   'user_id' => $user

                );

  $this->db->insert('ch_schedule', $data);

                echo "Successfully Uploaded";
            }
        }

推荐答案

(如果您的计算机是服务器) 所有将要访问和上传大文件的人都可以做到这一点 如果您要在php ini中更改最大文件上传量

if your machine is the server all people that will access and upload large file can do that if you will change your max file upload in you php ini

这是您的php.ini文件的链接

here is the link for you php.ini file

https://www.ostraining.com/blog/coding/phpini-file /

请确保在修改php.ini文件后重新启动Apache

Make sure to restart your Apache after amending your php.ini file

这篇关于我如何在Codeigniter中上传超过50MB的mp4视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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