• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
some wrong with upload

#1
view file
PHP Code:
<form method="post" action="" enctype="multipart/form-data">
<
input type="file" name="f1">
<
input type="submit" name="submit">
</
form

Controllers file
PHP Code:
    public function upload()
    {
        if(
$_POST){
            
$file $this->request->getFile('f1');
            
$newName $file->getRandomName();
            if (
$file->isValid() && ! $file->hasMoved()){
                
$file->move(WRITEPATH.'uploads'$newName);
            }
        }
        echo 
view('upload');


I got the error

Code:
Method CodeIgniter\HTTP\Header::__toString() must not throw an exception, caught ErrorException: Array to string conversion

May I know where the wrong is? thanks
Q&A for Codeigniter
StartBBS--open-source, light weight forum software.
Best VPS:Digital Ocean
Reply

#2
I fixed this problem. The pull request https://github.com/bcit-ci/CodeIgniter4/pull/308 until now still not merged.
Reply

#3
(11-19-2016, 08:54 PM)ridho Wrote: I fixed this problem. The pull request https://github.com/bcit-ci/CodeIgniter4/pull/308 until now still not merged.

Thanks a lot, Ridho.
Q&A for Codeigniter
StartBBS--open-source, light weight forum software.
Best VPS:Digital Ocean
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.