Permalink
Browse files

updating readme

  • Loading branch information...
1 parent 1e05b97 commit 2052ea1f601d312ea85ff338fa839722ee1af35e @josegonzalez josegonzalez committed Aug 16, 2009
Showing with 8 additions and 10 deletions.
  1. +8 −10 README.markdown
View
@@ -1,7 +1,9 @@
-# MeioUpload Behavior Plugin
+# MeioUpload 2.0 Behavior Plugin
This behavior provides to upload files in your application, as well as the possibility to translate the error message (originally only in portuguese) and the use of phpThumb as a better thumbnail generator.
+You can also use it in No-DB mode, which means that no data for the upload is stored within the database. You can further this by setting `var $useTable = false` in the model, which will both trigger No-DB mode AND allow quick uploads
+
## Installation
- Clone from github : in your behaviors directory type `git clone git://github.com/josegonzalez/MeioUpload.git plugins/meio_upload`
@@ -11,15 +13,13 @@ This behavior provides to upload files in your application, as well as the possi
* If you require thumbnails for image generation, download the latest copy of phpThumb and extract it into your vendors directory. Should end up like: /vendors/phpThumb/{files}. (http://phpthumb.sourceforge.net)
# Usage
-In a model that needs uploading, replace the class declaration with :
-
+In a model that needs uploading, replace the class declaration with something similar to the following:
<?php
class Image extends AppModel {
+ var $name = 'Image';
var $actsAs = array(
- 'MeioUpload.MeioUpload' => array(
- 'filename'
- )
+ 'MeioUpload.MeioUpload' => array('filename')
);
}
?>
@@ -50,8 +50,6 @@ Create your upload view, make sure it's a multipart/form-data form, and the file
?>
You'll want to include any other fields in your Model as well :)
-Make sure your directory (app/webroot/uploads/images/ in this case) is at least CHMOD 775, also check your php.ini MAX_FILE_SIZE is enough to support the filesizes you are uploading (default in the behavior is 2MB, can be configured)
-
-The behavior code will save the uploaded file's name in the 'filename' field in database, it will not overwrite existing files, instead it will create a new filename based on the original plus a counter. For thumbnails, when the file is uploaded, it will automatically create 3 thumbnail sizes (this can be configured) and prepend the name to the thumbfiles (i.e. image_001.jpg will produced thumb.small.image_001.jpg, thumb.medium.image_001.jpg, etc)
+Make sure your directory (app/webroot/uploads/image/ in this case, image changes to the name of your model) is at least CHMOD 775, also check your php.ini MAX_FILE_SIZE is enough to support the filesizes you are uploading (default in the behavior is 2MB, can be configured)
-More documentation to come. Check the behavior for more information :)
+The behavior code will save the uploaded file's name in the 'filename' field in database, it will not overwrite existing files, instead it will create a new filename based on the original plus a counter. For thumbnails, when the file is uploaded, it will automatically create 3 thumbnail sizes (this can be configured) and prepend the name to the thumbfiles as directories(i.e. app/webroot/uploads/image/image_001.jpg will produced app/webroot/uploads/thumb/small/image/image_001.jpg, app/webroot/uploads/thumb/medium/image/image_001.jpg, app/webroot/uploads/thumb/large/image/image_001.jpg)

0 comments on commit 2052ea1

Please sign in to comment.