Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Upload Runtime Notice #24

Open
daniyals opened this issue Mar 29, 2015 · 6 comments
Open

Upload Runtime Notice #24

daniyals opened this issue Mar 29, 2015 · 6 comments

Comments

@daniyals
Copy link

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
Copy link

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
Copy link

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
Copy link

@ayyazzafar are you using CodeIgniter 2 or 3?

@ghost
Copy link

ghost commented Jan 26, 2016

I modify a new version support "CodeIgniter 3"

@wmandai
Copy link

wmandai commented Mar 12, 2016

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants