CI3 Data Post file dan text kosong saat di debug di OS Ubuntu

Selamat pagi, mohon bantuan nya,

saya buat fungsi upload file di CI3 dengan server ubuntu, saat upload image dan text itu berjalan dengan baik, tapi ketika saya upload file mp4 itu data post nya kosong, tapi ini fungsi image sama video berbeda file php yah. tapi saya coba di os windows bisa 22 nya. saya sudah setting akses folder chmod 777, seting max size di php.ini di ubuntu masih kosong data post video nya. ada yang tau kah kenapa atau ada setingan lain di server ubuntu nya


<div class="card">
	<div class="card-header">
		<a>Custom background video website</a>
	<div class="card-body" style="color: black;">
		<h5 class="card-title"></h5>
		<div style="color:red">
			<?php echo validation_errors(); ?>
			<?php if(isset($error)){print $error;}?>
		<?php echo form_open_multipart('upload_file/file_data');?>
		<div class="mb-3">
			<label for="formFile" class="form-label">Name</label>
			<input type="text" class="form-control" name="pic_title" value="<?= set_value('pic_title'); ?>" id="pic_title">
		<div class="mb-3">
			<label for="formFile" class="form-label">Upload File</label>
			<input type="file" name="pic_file" class="form-control"  id="pic_file">
		<a href="<?=base_url();?>" class="btn btn-warning">Back</a>
		<button type="submit" name="proses" class="btn btn-success">Submit</button>


public function file_data(){

		// validate the form data
		// $this->load->library('upload');
		// if(isset($_POST['proses'])){
		// 	$this->form_validation->set_rules('pic_title', 'Video Title', 'required');

		// 	if ($this->form_validation->run() == FALSE){
		// 		$this->load->view('admins/header');
		// 		$this->load->view('admins/upload_form');
		// 		$this->load->view('admins/footer');
		// 	}else{

		// 		$data['pic_title'] = $this->input->post('pic_title', TRUE);
		// 		$config['upload_path']          = './upload/';
		// 		$config['allowed_types']        = 'mp4|mov';
		// 		$config['max_size']             = 90000;
	 //            $config['max_width']            = 1920;
	 //            $config['max_height']           = 1080;

		// 		$this->load->library('upload', $config);

		// 		if ( ! $this->upload->do_upload('pic_file')){
		// 			$error = array('error' => $this->upload->display_errors());
		// 			// $this->load->view('upload_form', $error);
		// 			$this->load->view('admins/header');
		// 			$this->load->view('admins/upload_form', $error);
		// 			$this->load->view('admins/footer');
		// 		}else{
		// 			$upload_data = $this->upload->data();
		// 			$data['pic_file'] = $upload_data['file_name'];
		// 			$this->model_pic->store_pic_data($data);
		// 			redirect('admin/heading');
		// 		}

		// 	}
		// }else{
		// 	var_dump('error');
		// }

avatar Obbytokun

182 Kontribusi 16 Poin

Diperbarui 2 bulan yang lalu

1 Jawaban:

Jawaban Terpilih

Based on your code, it seems that you are trying to upload a file with the name "pic_file" using the CodeIgniter upload library. However, you mentioned that when you try to upload an mp4 file, the POST data is empty.

This could be due to the default value of the post_max_size configuration directive in your php.ini file on your Ubuntu server being set to a lower value than the size of the mp4 file you are trying to upload. You can check this by creating a PHP file on your server with the following code:

<?php phpinfo();

This will output the PHP information on your server, and you can check the value of the post_max_size directive.

To fix this issue, you can increase the value of post_max_size in your php.ini file or in your .htaccess file. Here is an example of setting it to 50MB in your .htaccess file:

php_value post_max_size 50M

Additionally, you may want to check the value of upload_max_filesize in your php.ini file and set it to a value greater than the size of your mp4 file. This configuration directive sets the maximum size of an uploaded file.

If you have checked and adjusted these settings, and you are still unable to upload mp4 files, you may want to check the server logs for any error messages or try to debug your code further to see if there are any other issues with your upload function
avatar adamajalah27

55 Kontribusi 24 Poin

Dipost 2 bulan yang lalu


thanks for the answer.

Login untuk ikut Jawaban