-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, I'm trying to use fileupload element in zk 7.0.3:
<button id="btnUpload" label="Upload" upload="true,maxsize=-1" />
But, onUpload event is not rised.
Here is browser console log:
Refused to display 'http ://localhost:8080/DbUIBuilder/zkau/upload?uuid=oMIQa0&dtid=z_wai&sid=0&maxsize=-1' in a frame because it set 'X-Frame-Options' to 'DENY'.
What i am doing wrong?
Hello Darksu,
I use spring-security (not to be confused with the ZK Spring security). By default, it sets X-Frame-Options to DENY.
For zk framework X-Frame-Options should be set to SAMEORIGIN:
spring security xml configuration:
<http>
<logout logout-url="/logout" />
<headers>
<frame-options policy="SAMEORIGIN"/>
</headers>
</http>
or java configuration:
@EnableWebSecurity
public class WebSecurityConfig extends
WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
// ...
.headers()
.frameOptions().sameOrigin()
.httpStrictTransportSecurity().disable();
}
}
This configuration fixes the problem.
Hello nsaazn,
Please try out the solution provided at the following url:
http://tracker.zkoss.org/browse/ZK-2471
Best Regards,
Darksu
Asked: 2015-11-23 18:17:54 +0800
Seen: 59 times
Last updated: Jan 17 '18