Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

113
Views
dropzone still keeping data after remove

i want to automatically checking a file, if the name file already exist in database its will be remove from dropzone. here is the dropzone option:

Dropzone.options.dropzone =
         {
            maxFilesize: 12,
            maxFiles:10,
            acceptedFiles: ".jpeg,.jpg,.png,.gif",
            timeout: 20000,
            parallelUploads:10,
            autoProcessQueue : false,
            addRemoveLinks:true,
            init:function(){
                this.on("addedfile",function(file){
                    
                    $.ajax({       
                        url:"{{ route('photo.cek') }}",
                        type: 'GET',
                        data:{
                            yohanes:file.name
                        },
                        dataType: 'json',
                        
                        success: function(data){
                            // var myDropzone;
                            console.log(data);
                            alert(data.success);
                            // var myDropzone = Dropzone.forElement(".dropzone");
                            // myDropzone.removeFile(file);
                            // alert(data.success);
                            $(file.previewElement).remove();
                           
                        }
                    });
                })

here is my controller :

public function cek(Request $request)
    {
        $till_code = $request->yohanes;

        $cek=DB::table('image_uploadeds')
        ->where('name','=',$till_code)
        ->first() ;
        if ($cek !=null) {
            return response()->json(array('success' => 'Till Code Already Exist !',
                                            'till_code'=> $till_code));
        }
    }

the image preview in dropzone is remove, but the data is still there. after i press the button for processqueque, the removed data still processed.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!