Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (31 sloc) 1.62 KB

Plupload component for Nette


Don't forget to load jQuery and jQuery UI manually.

There is no need for including any extra JS or Css in head. Everything is done automatically. If you prefer to do it by yourself then disable magic.


public function createComponentPlupload()
    // Main object
    $uploader = new Echo511\Plupload\Rooftop();

    // Use magic for loading Js and Css?
    // $uploader->disableMagic();

    // Configuring paths
    $uploader->setWwwDir(WWW_DIR) // Full path to your frontend directory
             ->setBasePath($this->template->basePath) // BasePath provided by Nette
             ->setTempLibsDir(WWW_DIR . '/plupload511/test'); // Full path to the location of plupload libs (js, css)

    // Configuring plupload
             ->setRuntimes(array('html5')) // Available: gears, flash, silverlight, browserplus, html5
             ->setMaxChunkSize('1mb'); // What is chunk you can find here:

    // Configuring uploader
             ->setTempUploadsDir(WWW_DIR . '/plupload511/tempDir') // Where should be placed temporaly files
             ->setToken("ahoj") // Resolves file names collisions in temp directory
             ->setOnSuccess(array($this, 'tests')); // Callback when upload is successful: returns Nette\Http\FileUpload

    return $uploader->getComponent();

See the code for more intel...