Using jQuery Form Plugin with JSON and BASIC to upload a file

Using jQuery Form Plugin with JSON and BASIC to upload a file

I'm working on a project that has a external API (build by others) and uses simple ajax-requests and BASIC-authentication to communicate with it. This works fine, but now I'm at the point to upload a file and I'm kind of stuck here. I found the jQuery Form Plugin, which able to dynamically create an iframe because files can't be transferred through javascript. Pretty nifty, but I need to alter the headers of this POST to include the BASIC-authentication (and maybe even as JSON). Is this possible?