file(), image() form()
A file input; the form becomes multipart/form-data. image() is the same with the default name image.
form()->file($name, $desc = '', $extra = [], $replace = [])
form()->image($name = '', $desc = '', $extra = [], $replace = [])Опції
| Опція | Значення |
|---|---|
accept | File types the browser offers (image/*, .pdf). |
(input options) | Every option of input(). |
Приклад
Код
return form()
->file('manual', 'Manual (PDF)', ['accept' => '.pdf'])
->image('', 'Photo', ['accept' => 'image/*']);Примітки
- The upload arrives in
$_FILES: check type, size and name on the server, store it outside the web root or under a generated name.
Див. також: form/upload