File upload
- Version 4.x
- Version 3.x
- Version 2.x
The @upload
annotation adds file upload to an ajax request.
It takes the id of the HTML field as a mandatory option.
It applies only to methods.
class JaxonExample
{
/**
* @upload('field' => 'div-user-file')
*/
public function saveFile()
{
// Get the uploaded files.
$files = $this->upload()->files();
}
}
The PHP-DOC syntax can also be used.
class JaxonExample
{
/**
* @upload div-user-file
*/
public function saveFile()
{
// Get the uploaded files.
$files = $this->upload()->files();
}
}