codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.4k stars 1.9k forks source link

Undefined variable $uploaded_fileinfo on https://codeigniter4.github.io/userguide/libraries/uploaded_files.html#the-success-page #7008

Closed SergeTkach closed 1 year ago

SergeTkach commented 1 year ago

PHP Version

8.1

CodeIgniter4 Version

4.2

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB

What happened?

I get error with file uploading

ErrorException Undefined variable $uploaded_fileinfo APPPATH\Views\common\upload_success.php at line 11

Steps to Reproduce

I have created script by instructions in documentation -- https://codeigniter4.github.io/userguide/libraries/uploaded_files.html#creating-the-upload-form

I understand that there is an mistake in documentation near:

$data = ['uploaded_flleinfo' => new File($filepath)]; It need to be: $data = ['uploaded_fileinfo' => new File($filepath)];

I mean there is char l instead of i in substring 'file'

Expected Output

Return file info after uploading

Anything else?

I have found mistake n documentation and described it

kenjis commented 1 year ago

Yes, it is a typo.

It was fixed in 4.3 branch. See #6983 But develop is not fixed.

PR is welcome.