I have a web page that allows a user to upload files using multipart/form data (i.e. with an input type="file" tag). However, here is a web content security filter in my way which is effectively blocking binary form data being submitted.
Is it possible to have have binary form data converted and sent as character data (e.g base64)? Preferably this would be done automatically by the browser through a declarative instruction if that is possible. I think it is not but thought I'd ask.
Otherwise, can it be done programmatically so that some JavaScript intercepts the form submission and changes the file content uploaded with the form data?
A solution based on wicket and/or jquery is preferable.
Note: I am not asking how to do base64 encoding in JavaScript. Please do not mark this as a duplicate without actually understanding the question first as did the five people who voted to close my first attempt of the question! How to send binary multipart formdata as base64?
The question is more about how to make any such encoding take place in the context of a multipart form submission.