I have a form that I am submitting via jQuery's ajaxSubmit()
function. This form includes a file control, and it has been raised as a possible point of failure that if the file selected is renamed, deleted, or otherwise made inaccessible prior to submitting the form, the form may or may not submit based on the browser. While the failure to submit is expected behavior, there is no indicator to the user that the form failed to submit or why, which is being considered a show-stopper. Worse, in IE, the form submits without any file data; while I can catch this on the server side, it would be more ideal if the form did not submit at all.
I am aware that JavaScript is restricted in being able to know anything about the filesystem, and I am similarly aware that there are some not-insignificant issues with anything having to do with cross-browser compatibility. Firefox doesn't seem to throw any kind of exception when the form submission fails, or jQuery is swallowing it. IE toddles along obliviously. I would like to see if there is a way to capture the fact that the form did not submit or submitted with an invalid file. I would also like to capture if there is a problem with the file field prior to submission.
Any ideas?