title: dropzone with cakephp 2.5
body: <p>My issue is that I want to integrate dropzone with cakephp 2.5; but after form submit
  <strong><em>$this->request->data['pic']</em></strong> returns empty array. But in drop zone when I add the image; it shows success image. Second; File not moves to target path "<strong><em>APP.'webroot'.DS.'uploadedpics'.DS</em></strong>"</p>
  
  <p>Please check my code below.</p>
  
  <p>I have included dropzone css and js files in default layout</p>
  
  <pre><code>echo $this-&gt;Html-&gt;css('dropzone/basic');
  echo $this-&gt;Html-&gt;css('dropzone/dropzone'); 
  
  echo $this-&gt;Html-&gt;script('js/dropzone/dropzone');
  echo $this-&gt;Html-&gt;script('js/dropzone/dropzone.min');
  echo $this-&gt;Html-&gt;script('js/dropzone/dropzone-amd-module');
  echo $this-&gt;Html-&gt;script('js/dropzone/dropzone-amd-module.min');
  </code></pre>
  
  <p>My HTML page have form and dropzone js:-</p>
  
  <pre><code>&lt;form method="post" action="/domain/controller/addpics" class="dropzone" id="mydropzone" enctype='multipart/form-data'&gt; 
  &lt;div id="dropzonePreview"&gt;&lt;/div&gt; &lt;!--// this will the dropzone drag and drop section .notice we have given it an id dropzonePreview .--&gt;
  &lt;input type="button" id="sbmtbtn" value="submit"/&gt;
  &lt;/form&gt;
  
  &lt;script&gt;
  Dropzone.options.mydropzone = {
  // url does not has to be written if we have wrote action in the form tag but i have mentioned here just for convenience sake 
  url: '/domain/controller/addpics', 
  addRemoveLinks: true,
  autoProcessQueue: false, // this is important as you dont want form to be submitted unless you have clicked the submit button
  autoDiscover: false,
  paramName: 'pic', // this is optional Like this one will get accessed in php by writing $_FILE['pic'] // if you dont specify it then bydefault it taked 'file' as paramName eg: $_FILE['file'] 
  previewsContainer: '#dropzonePreview', // we specify on which div id we must show the files
  clickable: false, // this tells that the dropzone will not be clickable . we have to do it because v dont want the whole form to be clickable 
  accept: function(file, done) {
  console.log("uploaded");
  done();
  },
  error: function(file, msg){
  alert(msg);
  },
  init: function() {
  
  var myDropzone = this;
  //now we will submit the form when the button is clicked
  $("#sbmtbtn").on('click',function(e) {
  e.preventDefault();
  myDropzone.processQueue(); // this will submit your form to the specified action path
  // after this, your whole form will get submitted with all the inputs + your files and the php code will remain as usual 
  //REMEMBER you DON'T have to call ajax or anything by yourself, dropzone will take care of that
  });
  
  } // init end
  
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>Controller code:-</p>
  
  <pre><code>function addpics() {
    $tempFile = $this-&gt;request-&gt;data['pic']['tmp_name'];          
    $targetPath = APP.'webroot'.DS.'uploadedpics'.DS;
    $targetFile =  $targetPath. $this-&gt;request-&gt;data['pic']['name'];
    move_uploaded_file($tempFile,$targetFile);
  }
  </code></pre>
  
  <p>Regards</p>