title: CKEditor file upload not working in Yii2
body: <p>I'm working on Yii2 Project where I've integrated <a href="http://ckeditor.com/demo" rel="nofollow noreferrer">http://ckeditor.com/demo</a></p>
  
  <p>Now I want to implement functionality of file/image upload in it.</p>
  
  <p>This is how I integrated CKEditor in Yii2 Project.</p>
  
  <p><strong>Step1: AppAsset.php</strong></p>
  
  <pre><code>public $js = [
      'ckeditor/ckeditor.js',
  ];
  </code></pre>
  
  <p>Calling ckeditor.js javascript file from <code>config/AppAsset</code> Class</p>
  
  <p><strong>Step2: View</strong></p>
  
  <pre><code>&lt;?= $form-&gt;field($model, 'standard_output_information')-&gt;textarea(['rows' =&gt; 2, 'class'=&gt;'ckeditor']) ?&gt;
  </code></pre>
  
  <p><strong>Step3: config.js</strong></p>
  
  <pre><code>CKEDITOR.editorConfig = function (config) {   
      var base_url = window.location.origin;
      var pathArray = window.location.pathname.split('/');
      var projectUrl = base_url + "/" + pathArray[1] + "/" + pathArray[2] + "/" + pathArray[3] + "/uploads";
  
      config.filebrowserImageBrowseUrl = base_url + "/pcwf" + "/backend" + "/web" + "/businessprocessprofile" + "/upload";
      config.filebrowserImageUploadUrl = base_url + "/pcwf" + "/backend" + "/web" + "/businessprocessprofile" + "/upload";    
  };
  </code></pre>
  
  <p>Here I've configured ImageBrowserUrl and ImageUploadUrl mentioned here <a href="http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)" rel="nofollow noreferrer">http://docs.cksource.com/CKEditor_3.x/Developers_Guide/File_Browser_(Uploader)</a></p>
  
  <p><strong>Step4: Controller</strong></p>
  
  <pre><code>public function actionUpload() {
      echo \yii\helpers\Html::csrfMetaTags();
  
      echo "&lt;pre&gt;";
      print_r($_FILES);
      print_r($_REQUEST);
      exit;
  }
  </code></pre>
  
  <p>Here I'm expecting uploaded image data. But whenever I click on <code>Send it to Server</code> button after selection of an image its giving me following error.</p>
  
  <p><img src="https://i.stack.imgur.com/esueA.png" alt="enter image description here"></p>
  
  <p>Not sure whether its issue of wrong url configuration in config.js or is it Yii2 form submission issue.</p>
  
  <p>Any help would be appreciated.</p>