Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to start with meioupload for cake php
    primarykey
    data
    text
    <p>i m new to cake php and tried to use meioupload for uploading file.,</p> <p>searched for a complete steps., but i m not sure whether i read the full docs..</p> <p>so here i m ., i ll discuss the things i did.,</p> <p>from this link <a href="http://www.meiocodigo.com/projects/meioupload/" rel="nofollow">http://www.meiocodigo.com/projects/meioupload/</a></p> <p>i created a table named "products"</p> <p>CREATE TABLE <code>products</code> ( <code>id</code> int(8) unsigned NOT NULL auto_increment, <code>name</code> varchar(255) default NULL, <code>description</code> text default NULL, <code>price</code> double default NULL, <code>picture</code> varchar(255) default NULL, <code>dir</code> varchar(255) default NULL, <code>mimetype</code> varchar(255) NULL, <code>filesize</code> int(11) unsigned default NULL, <code>created</code> datetime default NULL, <code>modified</code> datetime default NULL, PRIMARY KEY (<code>id</code>) )</p> <p>And then after adding the "$actAs" var in my model ., it looks like</p> <p>`</p> <p>Class product extends AppModel{</p> <pre><code>public $name="Product"; var $actsAs = array( 'MeioUpload' =&gt; array( 'picture' =&gt; array( 'dir' =&gt; 'uploads', 'create_directory' =&gt; true, 'max_size'=&gt;'10 Mb', 'allowed_mime' =&gt; array('image/jpeg', 'image/pjpeg', 'image/png'), 'allowed_ext' =&gt; array('.jpg', '.jpeg', '.png'), 'thumbsizes' =&gt; array( 'normal' =&gt; array('width'=&gt;200, 'height'=&gt;200), ), 'default' =&gt; 'default.jpg', ) ) ); </code></pre> <p>} `</p> <p>And uploaded MeioUploadBehavior.php file inside Model->Behaviour->MeioUploadBehavior.php from <a href="https://github.com/jrbasso/MeioUpload/blob/master/Model/Behavior/MeioUploadBehavior.php" rel="nofollow">https://github.com/jrbasso/MeioUpload/blob/master/Model/Behavior/MeioUploadBehavior.php</a></p> <p>My controller looks like</p> <pre><code>Class productscontroller extends AppController{ public $name="Products"; public function beforeFilter(){ $this-&gt;layout="admin"; } public function admin_upload(){ } </code></pre> <p>}</p> <p>And my view file from view->products->admin_upload.ctp</p> <pre><code>&lt;?php echo $this-&gt;Form-&gt;create('Product', array('type' =&gt; 'file')); echo $this-&gt;Form-&gt;input('picture', array('type' =&gt; 'file')); echo $this-&gt;Form-&gt;input('dir', array('type' =&gt; 'hidden')); echo $this-&gt;Form-&gt;input('mimetype', array('type' =&gt; 'hidden')); echo $this-&gt;Form-&gt;input('filesize', array('type' =&gt; 'hidden')); echo $this-&gt;Form-&gt;end('Submit'); </code></pre> <p>?></p> <p>when i run localhost/test/cake/admin/products/upload</p> <p>i see the form with filefield ans submit button.,</p> <p>and when i choose a image and submit., the form is successfully submitted and only a empty folder is created inside webroot->uploads->"thumb". No images moved to uploads and also thumb folder.,</p> <p>And also there is data inserted in the table as well..</p> <p>Do i need the save the data manually in my action !?</p> <p>Kindly help.</p> <p>Many Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload