Answer the question
In order to leave comments, you need to log in
What am I doing wrong when I install dropzonejs on yii?
here is my html
here is my javascript<div id="dropZed" class="dropzone"></div>
$("#dropZed").dropzone({ url: "/admin/MyGallery/create"});
Dropzone.options.myAwesomeDropzone = {
paramName: "img_url", // The name that will be used to transfer the file
method: 'files',
url: "/admin/MyGallery/create",
maxFilesize: 2 // MB
};
if(isset($_POST['submit'])){
if($_FILES['img_url']['error'] == 0){
move_uploaded_file($_FILES['img_url']['tmp_name'],
Yii::app()->request->baseUrl . 'images/upload/' . $_FILES['img_url']['name']);
}
} else echo "ERORR TEXT";
$model->img_url = $_FILES['img_url']['name'];
$model->save()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question