2015-02-05 7 views
2

나는 이미지를 업로드하기 위해 dropzone 확장을 사용하고 있습니다. 그것은 매력처럼 작동합니다. 하지만 난 문서 파일 docx, xls, xlsx를 업로드하고 싶다.dropzone.js는 .doc, .xls, .xlsx 파일 형식을 업로드하지 않습니다.

$this->widget('ext.dropzone.EDropzone', array(
        'model' => $model, 
        'attribute' => 'image_name', 
        'url' => Yii::app()->request->baseUrl.'/jobMaster/ImageUpload', 
        'mimeTypes' => array('image/jpeg', 'image/png','image/jpg'), 
        'onSuccess' => 'succcesupload', 
        //'maxFilesize'=> 5, 
        'options' => array(
         'addRemoveLinks'=> true, 
        'removedfile'=> "js:function(file) { 
         var name = file.name;   
         $.ajax({ 
          type: 'POST', 
          url: '".$this->createUrl('/jobMaster/deleteImageUpload')."', 
          data: 'id='+name, 
          dataType: 'html' 
         }); 
         var _ref; 
         return (_ref = file.previewElement) != null ? _ref.parentNode.removeChild(file.previewElement) : void 0;   
             }" 
       ) 
        )); 

그러나이 위젯에서 변경하는 방법을 모르겠습니다.

은 내가

'mimeTypes' => array('image/jpeg', 'image/png','image/jpg','file/doc','file/xls','file/xlsx','file/docx'), 

을 변경했지만 작동하지 않습니다. 어떤 대답입니까?

답변

6
여기

내가 솔루션을 가지고

'mimeTypes' => array('image/jpeg', 'image/png','image/jpg','application/vnd.ms-excel','application/vnd.openxmlformats-officedocument.wordprocessingml.document','application/docx','application/pdf','text/plain','application/msword','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'),