Possible Duplicate:
How can you encode to Base64 using Javascript?
I have a web application based on Java, Wicket and JQuery which has a function to enable users to upload files (images, pdfs, rtf) through multipart/form-data.
Our web security infrastructure does filtering of all http traffic to pick up possibly malicious content e.g. XSS attacks, SQL injection, buffer overruns etc
The filter doesn't distinguish between normal text input fields and file data so it picks up false positives from many uploaded binary files, preventing those files from being uploaded. I cannot change the security policy.
It seems the best way around this would be for file data to be base-64 encoded so that it is sent with a Content-Transfer-Encoding:base64 similar to what email clients do.
Is there any way to direct the browser to transfer binary as base64 or some other non-binary format?
If not, could it be done manually with some JavaScript?