0

In my project i use the following stack:

java 7
spring-boot 1.3.8
wicket 6.26.0
wicket-bootstrap 0.9.21

Now i want to implement a file upload using BootstrapFileInputField.

Here my wicket html:

<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
</head>

<body>
    <div class="container">
        <div wicket:id="alert"></div>
        <form wicket:id="form">
            <input type="file" wicket:id="fileInput" multiple="multiple"/>
        </form>
    </div>
</body>

</html>

And my java wicket class looks like this:

form = new BootstrapForm<>("form");
form.setOutputMarkupId(true);
form.setMultiPart(true);
form.setFileMaxSize(Bytes.megabytes(5));

If i upload a file smaller than 5 mb all is ok. But, when i'm uploading a file greater than max file size an ajax error occurs.

Ajax error:

ERROR: Cannot read Ajax response for multipart form submit: SecurityError: Blocked a frame with origin "http://localhost:8080" from accessing a cross-origin frame.
ERROR: Wicket.Ajax.Call.failure: Error while parsing response: No XML response in the IFrame document

But when I remove the max file size, i can upload the same file without errors. How can i resolve this issue?

The code is also on github

Tomschi
  • 3
  • 1

1 Answers1

0

Do you deploy on Tomcat ? Recently a user reported that he experienced the same issue and solved it by changing Tomcat's maxSwallowSize - http://markmail.org/message/n53epxuqkwf4ze4t

Also see http://www.mkyong.com/spring-boot/spring-boot-configure-maxswallowsize-in-embedded-tomcat/

martin-g
  • 17,243
  • 2
  • 23
  • 35