CodeIgniter-Multi-Upload icon indicating copy to clipboard operation
CodeIgniter-Multi-Upload copied to clipboard

Upload Runtime Notice

Open daniyals opened this issue 9 years ago • 6 comments

Getting this message running Codeigniter 3.0.0 RC3

Declaration of MY_Upload::initialize() should be compatible with CI_Upload::initialize(array $config = Array, $reset = true)

daniyals avatar Mar 29 '15 09:03 daniyals

I would assume (or at least hope) that Codeigniter 3 has multi-upload ability built it. I would also assume that Codeigniter 3 is going to break a lot of libraries, such as this CodeIgnite-Multi-Upload.

goosehub avatar Mar 31 '15 18:03 goosehub

I am getting this error when I tried to upload file:

Severity: Runtime Notice

Message: Declaration of MY_Upload::initialize() should be compatible with CI_Upload::initialize(array $config = Array, $reset = true)

Filename: libraries/MY_Upload.php

Line Number: 444

Please guide us that how can we resolve this issue?

ayyazzafar avatar Dec 12 '15 09:12 ayyazzafar

@ayyazzafar are you using CodeIgniter 2 or 3?

goosehub avatar Dec 14 '15 15:12 goosehub

I modify a new version support "CodeIgniter 3"

ghost avatar Jan 26 '16 08:01 ghost

Solution for Codeigniter 3 Open MY_Upload.php around line 32 replace with; public function initialize(array $config = array(), $reset = TRUE){ then change line 385 to $this->file_name = sanitize_filename($this->file_name);

Remember to load $this->load->helper('security'); in your Controller

wmandai avatar Mar 12 '16 11:03 wmandai

In My_upload.php file replace the line 385 by the following code

//Sanitize the file name for security. $this->file_name = sanitize_filename($this->file_name);

// Sanitize the file name for security $this->file_name = $this->_CI->security->sanitize_filename($this->file_name);

abner-carvalho avatar Aug 22 '16 21:08 abner-carvalho