Hi how would I send a file to a server through action in Javascript
///
<script>
function go()
{
document.MyForm.action = "http://"+document.Config.IP.value+":"+document.Config.PORT.value
document.MyForm.submit();
}
</script>
so instead of sending the form i send the FILE (root.xml)
how would i go about doing this?
Well, you can do this with JavaScript, but it’s difficult and not widely supported. The new File API allows your browser-based code ringfenced access to specific files.
But by far the more useful, and universally-supported, mechanism is to have a
fileinput in a form that gets submitted:If the user selects a file, when that form is submitted (which you can do via
Form#submitif you like) the file is transmitted with it. No special handling involved.