Ci framework and video upload problems

Source: Internet
Author: User
The ci framework and the question of video upload. I am new to the ci framework. many of them are unclear. Recently, I encountered some difficulties in developing a file upload function.
// $ Id is the id of this article, meaning that each folder can only store 50 videos public function addmove ($ id) {$ uid = $ this-> session-> userdata ('id'); $ a = (int) ($ id/50); $ up_file_path = FILEPATH. 'movies /'. $ a; if (is_dir ($ up_file_path) {$ up_file_path = $ up_file_path;} else {mkdir ($ up_file_path, 0777 );} $ config ['upload _ path'] = $ up_file_path; $ config ['allowed _ types '] = 'mp4 | avi '; $ config ['max _ size'] = '000000'; $ this-> load-> library ('upload', $ config); $ This-> upload-> do_upload ("fileurl"); if (! $ This-> upload-> do_upload ('fileurl') {$ error = array ('error' => $ this-> upload-> display_errors ());} $ data = $ this-> upload-> data (); $ strlen = strlen (FILEPATH); $ movepath = substr ($ data ['full _ path'], $ strlen); $ data1 = array ('fileurl' => '/media /'. $ movepath, 'File _ name' => $ data ['raw _ name']); $ this-> db-> where ('id', $ id ); $ this-> db-> update ('content', $ data1 );}

Problem:
1. there are not many files. Should the directory I have stored be correct?
2. video files in this directory can be downloaded in windows. video files cannot be downloaded in linux. the error 404 is displayed (the file cannot be found );
3. this program does not upload the video to the corresponding folder. I do not know where the problem occurs.

Thank you for solving the problem.


Reply to discussion (solution)

2. video files in this directory can be downloaded in windows. video files cannot be downloaded in linux. the error 404 is displayed (the file cannot be found );
The stored directory is/media/movies/1/I love you .mp4

Add the mime type in config. php.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.