I want to upload a video or mp4 file type.
The backend
<label>File</label>
<input type="file" name="img_url" class="form-control form-control-line" placeholder=" Result" required>
<div class="form-actions col-md-6">
<input type="hidden" name="proid" value="<?php echo $details->id; ?>">
<button type="submit" class="btn btn-success"> <i class="fa fa-check"></i> Save</button>
<button type="button" class="btn btn-danger">Cancel</button>
The controller
$file_name = $_FILES['img_url']['name'];
$fileSize = $_FILES["img_url"]["size"];
$fileType = $_FILES["img_url"]["type"];
$config = array(
'file_name' => $file_name,
'upload_path' => "./assets/images/projects",
'allowed_types' => "gif|jpg|png|jpeg|pdf|doc|docx|mp3|mpeg|mp4|video",
'overwrite' => False,
'max_size' => "40480000",
'max_height' => "3600",
'max_width' => "3600"
);
$this->load->library('upload', $config);
$this->upload->initialize($config);
if (!$this->upload->do_upload('img_url')) {
echo $this->upload->display_errors();
I want to save a mp4 file but its now working
New contributor
Lenberd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.