function submitForms() {
window.open("", "smallPopup", "location=1, status=1, scrollbars=1, width=100, height=100");
var theForm = document.myForm;
theForm.action = "http://firstSite.com/backup";
theForm.target = "smallPopup";
theForm.submit();
theForm.action = "http://2ndSite.com/receive";
theForm.target = "_self";
theForm.submit();
}
Now you might wonder why I didn't just create another form and have two forms, one for each server. The problem with that is the user would have to select the file twice, once for each form. This is because for security reasons, it is not possible to programmatically set the file path in an HTML input of type file. So a programmer is prevented from assigning the path of one input tag to be the same as another input tag of type file. A programmer only has read access to the file path. Of course this makes a lot of sense too because if it were possible then any malicious site would be able to upload any file its owner wishes from your computer to his server.
No comments:
Post a Comment