Changeset 18961
- Timestamp:
- 06/05/09 16:14:16 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/pkPersistentFileUploadPlugin/trunk/README
r17920 r18961 37 37 * pkToolkitPlugin 38 38 39 And, optionally: 40 41 * pkImageConverterPlugin 42 43 If you wish to enable the image-preview option while adding the widget, which displays a thumbnail 44 of successfully uploaded image files while the user completes additional validation passes 45 over the form. 46 39 47 That's it. You do not need to use any particular ORM 40 48 because the persistent cache of file uploads is implemented via the filesystem. … … 42 50 ## Installation 43 51 44 Newly uploaded files are copied to a subfolder of your project's45 `data` folder called `pk-writable`, which is created for you46 if it does not already exist. Note that if the permissions of your47 `data` folder do not permit this, you'll need to manually create the48 `data/pk-writable` folder and make sure it is readable, writable and49 executable by the web server. Creating this one folder will take care50 of the non-database data storage needs of all P'unk Avenue plugins.51 52 Note that 777 permissions are only appropriate when your web server53 runs as a user who otherwise can't touch any files (but this is54 standard practice with many hosting setups):52 Newly uploaded files are copied to a subfolder of your project's 53 `data` folder called `pk-writable`, which is created for you 54 if it does not already exist. Note that if the permissions of your 55 `data` folder do not permit this, you'll need to manually create the 56 `data/pk-writable` folder and make sure it is readable, writable and 57 executable by the web server. Creating this one folder will take care 58 of the non-database data storage needs of all P'unk Avenue plugins. 59 60 Note that 777 permissions are only appropriate when your web server 61 runs as a user who otherwise can't touch any files (but this is 62 standard practice with many hosting setups): 55 63 56 64 mkdir data/pk-writable 57 65 chmod 777 data/pk-writable 66 67 If you are using the image-preview feature, a `web/uploads/uploaded_image_preview` 68 will be automatically created to hold the previews, which are automatically aged off 69 as needed, just as the persistent upload folder's contents are. 58 70 59 71 ## Usage … … 64 76 $this->setWidget('file', new pkWidgetFormInputFilePersistent()); 65 77 $this->setValidator('file', new pkValidatorFilePersistent( 66 array("mime_types" => array("image/jpeg")))); 78 array("mime_types" => array("image/jpeg"), 79 "image-preview" => true))); 67 80 68 81 You can pass all of the usual options to both the widget and 69 82 the validator. This particular example accepts only JPEG images. 83 84 Note that you should not enable the `image-preview` option unless you are expecting 85 only image files. 70 86 71 87 ## Telling the User What's Going On plugins/pkPersistentFileUploadPlugin/trunk/lib/widget/pkWidgetFormInputFilePersistent.class.php
r17536 r18961 67 67 if ($exists) 68 68 { 69 if ($this->hasOption('image-preview')) 69 // hasOption just verifies that the option is valid, it doesn't check what, 70 // if anything, was passed. Thanks to Lucjan Wilczewski 71 if ($this->hasOption('image-preview') && $this->getOption('image-preview')) 70 72 { 71 73 // Note change of key plugins/pkPersistentFileUploadPlugin/trunk/package.xml.tmpl
r18703 r18961 79 79 <release> 80 80 <version> 81 <release>0.9.1</release> 82 <api>1.0.0</api> 83 </version> 84 <stability> 85 <release>beta</release> 86 <api>stable</api> 87 </stability> 88 <license uri="http://www.symfony-project.org/license">MIT license</license> 89 <date>2009-06-05</date> 90 <notes>image-preview option was turning on no matter what (thanks to Lucjan Wilczewski for finding this bug). Documentation now covers how to enable that option, and the need to install pkImageConverterPlugin if you want to use that option.</notes> 91 </release> 92 <release> 93 <version> 81 94 <release>0.5.0</release> 82 95 <api>1.0.0</api>