Hochgeladene Datei enthält nur "WebKitFormBoundary"

Ich weiß wirklich nicht, was hier Los ist. Jedes mal, wenn ich versuche eine Datei hochzuladen, alle die in der Datei enthalten ist:

------WebKitFormBoundaryJ0uWMNv89fcUsC1t--

Ich suchte die letzten 2 Tage für eine Art Erklärung, aber ich bin gerade dabei im Kreis. Ich habe keine Ahnung, warum dies geschieht.

Form:

<form id="upload-file" ecntype="multipart/form-data">
    <input name="picture" type="file">
    <input type="button" value="Upload" id="upload-button" />
</form>

Javascript:

$('#upload-button').click(function(e){
        e.preventDefault();
        var formData = new FormData($('#upload-file'));
        $.ajax({
            url: '/image',  
            type: 'POST',
            xhr: function() {  
                var myXhr = $.ajaxSettings.xhr();
                if(myXhr.upload){ 
                    myXhr.upload.addEventListener('progress',progressHandlingFunction, false);
                }
                return myXhr;
            },
            data: formData,
            cache: false,
           //contentType: false,
            processData: false
        });
    });

Controller:

def image = Action(parse.temporaryFile) { request =>
   request.body.moveTo(new File("/tmp/picture"))
   Ok("File uploaded")
}
InformationsquelleAutor bad at scala | 2014-07-15
Schreibe einen Kommentar