I am working on a small page I want to use for myself at home. I am trying to load the name of a file along with it's path into and Ajax call but all I get is the file name. Here is the 4 attempts I have made:
I would like to get this value transmitted
C:\Documents and Settings\Claus\My Documents\Maps\tracks\Dandy Horse.gpx
but all I get is
Dandy Horse.gpx
or
Dandy%20Horse.gpx
-
<head>
-
<script type="text/javascript">
-
<!--
-
-
var GPXHttp;
-
-
function sendGPXFile()
-
{
-
if (window.ActiveXObject)
-
{
-
GPXHttp = new ActiveXObject("Microsoft.XMLHTTP");
-
}else if (window.XMLHttpRequest) {
-
GPXHttp = new XMLHttpRequest();
-
}
-
var url = "/ABC/apps/readGPX.exe?timeStamp=" + new Date().getTime();
-
-
//here are the 4 attempts
-
//do I need to say that I tried each of these one at a time.
-
var queryString = document.getElementById("GPXinput").value;
-
var queryString = escape(document.getElementById("GPXinput").value);
-
var queryString = encodeURI(document.getElementById("GPXinput").value);
-
var queryString = encodeURIComponent(document.getElementById("GPXinput").value);
-
-
GPXHttp.onreadystatechange = handleStateChange;
-
GPXHttp.open("POST", url, true);
-
GPXHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-
-
alert("input = "+document.getElementById("GPXinput").value+" query="+queryString);
-
-
GPXHttp.send(queryString);
-
}
-
-
//-->
-
</script>
-
</head>
-
<body>
-
<input type="file" id="GPXinput" value="gpxfile" size="100" onclick="" /><br />
-
<input type="button" value="Send File" onclick="sendGPXFile();" />
-
</body>
-
-
-
-