When making an ajax call for form submission, it is possible to set headers before sending the request to the server. But what if you are using a specific action "URL" to send data to the server? How can you set any header for that request?
Case 1:
<form onsubmit="somefn()">
<input type="text">
<input type="file">
<input type="submit">
</form>
In Case 1, you can make an ajax call in "somefn()" and set request headers before sending the form data.
Case 2: (Addressing IE9 issue)
<form action="/someurl">
<input type="text">
<input type="file">
<input type="submit">
</form>
In this scenario, the form will be submitted to the specified action URL. How do you set headers for this request when no ajax call is involved? It's a normal form submit process.
The actual situation involves file upload in IE 9 using an "iframe" for submission. However, an "authtoken" needs to be sent along with the request. While other browsers use http requests where setting the "authtoken" is straightforward.
How can this be achieved? Any assistance would be appreciated.