Net-9fsw7BzdjC
New member
I've developed a rather basic front end interface for an intended file handling HTML page that would launch upon insertion of a USB device in which will be it's home.
Below I've pasted an excerpt of what I intend to be structure but can't sort out as to how to get the selected file opened from file manager to save to the 'root' of the webpage
<input type="button" id="btnFileUpload" value="Select File" />
<span id="spnFilePath"></span>
<input type="file" id="FileUpload" style="display: show" />
<script type="text/javascript">
window.onload = function () {
var fileupload = document.getElementById("FileUpload1");
var filePath = document.getElementById("spnFilePath");
var button = document.getElementById("btnFileUpload");
button.onclick = function () {
fileupload.click();
};
fileupload.onchange = function () {
var fileName = fileupload.value.split('\\')[fileupload.value.split('\\').length - 1];
filePath.innerHTML = "<b>Selected File: </b>" + fileName;
};
};
</script>
Below I've pasted an excerpt of what I intend to be structure but can't sort out as to how to get the selected file opened from file manager to save to the 'root' of the webpage
<input type="button" id="btnFileUpload" value="Select File" />
<span id="spnFilePath"></span>
<input type="file" id="FileUpload" style="display: show" />
<script type="text/javascript">
window.onload = function () {
var fileupload = document.getElementById("FileUpload1");
var filePath = document.getElementById("spnFilePath");
var button = document.getElementById("btnFileUpload");
button.onclick = function () {
fileupload.click();
};
fileupload.onchange = function () {
var fileName = fileupload.value.split('\\')[fileupload.value.split('\\').length - 1];
filePath.innerHTML = "<b>Selected File: </b>" + fileName;
};
};
</script>