function getFile($slot_name, $target, $exts = NULL, $generate_names = false)
    {
        if(!$target) {
            throw new \Exception("Can't move file without destination.");
        }

        if(!array_key_exists($slot_name, $_FILES)) {
            return false;
        }

        $return = false;

        // Several files uploaded with the same name like uploads[].
        if(is_array($_FILES[$slot_name]['name'])) {
            if(!is_dir($target)) {
                throw new Exception("Target `$target' must be a directory for several files.");
            }

            $return = array();
            for($file_num = 0; $file_num < count($_FILES[$slot_name]['name']); $file_num++) {
                $file = array(
                    'name' => $_FILES[$slot_name]['name'][$file_num],
                    'type' => $_FILES[$slot_name]['type'][$file_num],
                    'tmp_name' => $_FILES[$slot_name]['tmp_name'][$file_num],
                    'error' => $_FILES[$slot_name]['error'][$file_num],
                    'size' => $_FILES[$slot_name]['size'][$file_num]
                    );

                $looptarget = '';
                if($generate_names) {
                    // Getting the ext. I don't use pathinfo() because the file may not exist...
                    $ext = substr(strrchr($file['name'], '.'), 0);
                    $looptarget = Utils::uniqueFilename($target, '', $ext);
                } else {
                    $looptarget = Utils::joinPaths($target, basename($file['name']));
                }

                try {
                    $return[] = $this->_getAndMoveFile($file, $looptarget, $exts);
                }
                catch(FileUploadError $e) {
                    $return[] = $e;
                }
            }
        } else {
            if(is_dir($target)) {
                if($generate_names) {
                    $ext = substr(strrchr($_FILES[$slot_name]['name'], '.'), 0);
                    $target = Utils::uniqueFilename($target, '', $ext);
                } else {
                    $target = Utils::joinPaths($target, basename($_FILES[$slot_name]['name']));
                }
            }

            try {
                $return = $this->_getAndMoveFile($_FILES[$slot_name], $target, $exts);
            }
            catch(FileUploadError $e)
            {
                return $e;
            }
        }

        return $return;
    }