What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

USB Front-end webpage [Offline]

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>
 
Back
Top