Welcome Guest, Not a member yet? Register   Sign In
Call to a member function hasFile() on array
#1

Call to a member function hasFile() on array
Code:
$files = $this->request->getFiles();
if ($files->hasFile('image')) {
    $image = $files->getFile('image');
    $imageName = $image->getRandomName();
    $this->handle_file($image, $imageName, 'images', $post['image']);
    $postData['image'] = $imageName;
}
Reply
#2

Documentation error. The getFiles() method returns an array.
This is actually what the error says.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB