javascript - Error when uploading images using Play! Framework on Google Chrome -
i'm using play! framework , i'm having troubles make upload of images, in google chrome:
[error] play - exception caught in requestbodyhandler java.nio.channels.closedchannelexception: null @ org.jboss.netty.channel.socket.nio.abstractnioworker.cleanupwritebuffer(abstractnioworker.java:433) @ org.jboss.netty.channel.socket.nio.abstractnioworker.writefromusercode(abstractnioworker.java:128) @ org.jboss.netty.channel.socket.nio.nioserversocketpipelinesink.handleacceptedsocket(nioserversocketpipelinesink.java:99) @ org.jboss.netty.channel.socket.nio.nioserversocketpipelinesink.eventsunk(nioserversocketpipelinesink.java:36) @ org.jboss.netty.channel.defaultchannelpipeline$defaultchannelhandlercontext.senddownstream(defaultchannelpipeline.java:779
on client-side, request code:
var formdata = new formdata(); (var = 0; < $scope.images.length; i++) { formdata.append('picture' + i, $scope.images[i]); } $http.post('/resource/ad/' + id + '/upload', formdata, { transformrequest: angular.identity, headers: {'content-type': undefined} });
on server, it's that:
play.mvc.http.multipartformdata body = request().body().asmultipartformdata(); list<http.multipartformdata.filepart> files = body.getfiles();
i changed values of parameters in application.conf:
parsers.multipartformdata.maxlength=50240k play.http.parser.maxdiskbuffer=50240k play.http.parser.maxmemorybuffer=50240k
the funny thing happens in chrome. in firefox, example, it's working.
can me? thanks!
Comments
Post a Comment