Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda