Skip to content
Newer
Older
100644 43 lines (31 sloc) 1.62 KB
11d0679 @echo511 README
echo511 authored Jul 14, 2012
1 Plupload component for Nette
2 ============================
3
4 Implementation:
5 ---------------
6
7 Don't forget to load jQuery and jQuery UI manually.
8
9 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.
10
11
12 Usage
13 -----
14
15 public function createComponentPlupload()
16 {
17 // Main object
80bdd65 @echo511 README
echo511 authored Jul 19, 2012
18 $uploader = new Echo511\Plupload\Rooftop();
11d0679 @echo511 README
echo511 authored Jul 14, 2012
19
20 // Use magic for loading Js and Css?
21 // $uploader->disableMagic();
22
23 // Configuring paths
24 $uploader->setWwwDir(WWW_DIR) // Full path to your frontend directory
25 ->setBasePath($this->template->basePath) // BasePath provided by Nette
26 ->setTempLibsDir(WWW_DIR . '/plupload511/test'); // Full path to the location of plupload libs (js, css)
27
28 // Configuring plupload
29 $uploader->createSettings()
30 ->setRuntimes(array('html5')) // Available: gears, flash, silverlight, browserplus, html5
31 ->setMaxFileSize('1000mb')
32 ->setMaxChunkSize('1mb'); // What is chunk you can find here: http://www.plupload.com/documentation.php
33
34 // Configuring uploader
35 $uploader->createUploader()
36 ->setTempUploadsDir(WWW_DIR . '/plupload511/tempDir') // Where should be placed temporaly files
37 ->setToken("ahoj") // Resolves file names collisions in temp directory
38 ->setOnSuccess(array($this, 'tests')); // Callback when upload is successful: returns Nette\Http\FileUpload
39
40 return $uploader->getComponent();
41 }
42
43 See the code for more intel...
Something went wrong with that request. Please try again.