INTERACTIVE EXAMPLE
Antiforgery Token
This demo posts to a CSRF-protected endpoint. Leave the token enabled for a normal upload, then switch it off to watch the server reject the request with a real validation error.
What you should see: uploads go to a CSRF-protected endpoint and succeed with a valid token attached. Every request — including chunks — carries the token, so an expired session fails here rather than silently storing the file.
Current Demo Token
CfDJ8JK8lieumkVGnNqVMLQLrkVFS3XtnPfb1V8JiDdEXCoEcfkqu5LI5FgmMT4aa3ATzFVZi-YJIBPVK8mUUZyK5RpLYVgjRyPy8Qb2lhZyYVcZy1DsFWTDHUkjuYg5tv02PX5TMj3-NF9bU6Da79S-3gk
Ready. Upload with the token enabled, then disable it to trigger server-side CSRF validation.
CoreUpload.create('#antiforgery-uploader', {
uploadUrl: '/demo/security/antiforgery-upload',
buttonText: 'Upload with Antiforgery Protection',
multiple: true,
autoUpload: true,
headers: function () {
return sendToken.checked
? { 'X-XSRF-TOKEN': requestToken }
: {};
}
});