@using (Html.BeginForm("Upload", "MyProfile", FormMethod.Post, new
{
@encType = "multipart/form-data",
id = "ImgForm",
name = "ImgForm",
target = "UploadTarget"
}))
{
<input type="file" name="FileUpload" class="filestyle-notext fileupload">
}
<iframe id="UploadTarget" name="UploadTarget" style="position: absolute; left: -999em; top: -999em;"></iframe>
And through javascript/jquery, I am doing form submit on change of file input.
$('.myprofile .fileupload').change(function () {
$('#ImgForm').submit();
});
It throws an error: Access is denied and It happens only in IE (i am using ie8) and works fine in firefox, chrome.
After reading in forums I see there is an issue with form submit through javasript in IE due to security reasons but is there any workaround ? And I don't understand why the hell only IE does that when all browsers are supporting it. Is IE more secure than all browsers ? ;) Pool in your suggestions please.