stvnthomas / CodeIgniter-Multi-Upload

Multiple file upload support for CodeIgniter 2.x.
151 stars 158 forks source link

Upload Runtime Notice #24

Open daniyals opened 9 years ago

daniyals commented 9 years ago

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)

goosehub commented 9 years ago

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.

ayyazzafar commented 8 years ago

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?

goosehub commented 8 years ago

@ayyazzafar are you using CodeIgniter 2 or 3?

ghost commented 8 years ago

I modify a new version support "CodeIgniter 3"

wmandai commented 8 years ago

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

abner-carvalho commented 8 years ago

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);