How to display error message of jquery dropzone

前端 未结 3 1021
时光说笑
时光说笑 2021-02-12 11:26

I use dropzone with CI, i don\'t know how to display error message and custom message when upload false, this is my script

Dropzone.autoDiscover = false;
               


        
3条回答
  •  一个人的身影
    2021-02-12 12:12

    You can simply echo back the message from server via PHP file

    if($file_uploaded == true)
    {
    
       //perform operations on valid upload
    
    } else {
    
      //upload failed, echo back negative response to dropzone.js
      $this->output->set_header("HTTP/1.0 400 Bad Request");
      echo "Error uploading file";
    
    }
    

    While your HTML file can look like:

    
    

    Hope it helps :)

提交回复
热议问题