david001's avatar

Add remove link in dropzone image upload

Help,

How can i add remove link when images uploded and shown in browser i want to show remove link that remove individual image.here is my code what i should do in controller and js to have remove button

<!DOCTYPE html>
<html>
<link href="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/min/dropzone.min.css" rel="stylesheet">
</head>
<body>
    <div class="container">
        <div class="dropzone" id="dropzoneFileUpload">
        </div>
    </div>
 
    <script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/4.0.1/dropzone.js"></script>
 
    <script type="text/javascript">
        var baseUrl = "{{ url('/') }}";
        var token = "{{ Session::getToken() }}";
        Dropzone.autoDiscover = false;



        var myDropzone = new Dropzone("div#dropzoneFileUpload", {
            url: baseUrl + "/dropzone/uploadFiles",
            params: {
                _token: token
            }
        });
        Dropzone.options.myAwesomeDropzone = {
            paramName: "file", // The name that will be used to transfer the file
            maxFilesize: 2, // MB
            addRemoveLinks: true,


            accept: function(file, done) {
 
            },
       
        };
    </script>

</body>
</html>
public function deleteUpload()
    {

        $filename = Input::get('id');

        if(!$filename)
        {
            return 0;
        }

        $response = $this->image->delete( $filename );

        return $response;
    }
0 likes
0 replies

Please or to participate in this conversation.