PHP code example of tacoberu / nette-form-fileupload

1. Go to this page and download the library: Download tacoberu/nette-form-fileupload library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tacoberu / nette-form-fileupload example snippets


use Taco\Nette\Forms\Controls\FileCurrent;
use Taco\Nette\Forms\Controls\FileControl;
use Taco\Nette\Forms\Controls\GenericFilePreviewer;

$form = new Nette\Forms\Form;

$form['portrait'] = (new FileControl('Portrait:'))
	->setDefaultValue(new FileCurrent("uploaded/account/56695/mp16.jpg", "image/jpeg"))
	->setPreviewer(new GenericFilePreviewer());



$form['portrait']->destroyStore();