brandonsavage / Upload

File uploads with validation and storage strategies
MIT License
1.67k stars 315 forks source link

File validation Fail #85

Closed rafa-acioly closed 8 years ago

rafa-acioly commented 8 years ago

I'm trying to make a upload and my application (with slim framework) just return File validation fail, but my validation are;

$file->addValidations(array(
            new \Upload\Validation\Mimetype(array('image/png', 'image/jpg')),
            new \Upload\Validation\Size('15M')
        ));

And the image:

p.s: I'm using ajax.

$(".form").on("submit", function (event) {
       event.preventDefault();
       var formData = new FormData(this);
        $.ajax({
            url: 'upload',
            type: "POST",
            data: formData,
            cache: false,
            contentType: false,
            processData: false,
            success: function(data){
                $(".form-upload").slideToggle("slow");
                $(".result img").attr("src", data);
                $(".result").slideToggle("slow");
            }
        });

    });

the only thing that i can see is that my response is "404 not found" because the url don't existe; `http://myapp.dev/File validation fail```

williamespindola commented 8 years ago

Hi @rafa-acioly with this descriptions is hard to understand the error. If your route is 404 I think the route that must is not receive request with data files.