Welcome Guest, Not a member yet? Register   Sign In
some wrong with upload
#1

(This post was last modified: 11-19-2016, 07:03 PM by startbbs.)

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


Messages In This Thread
some wrong with upload - by startbbs - 11-19-2016, 06:58 PM
RE: some wrong with upload - by ridho - 11-19-2016, 07:54 PM
RE: some wrong with upload - by startbbs - 11-19-2016, 08:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB