mirror of
https://github.com/alvierahman90/uploadr.git
synced 2025-01-12 02:04:20 +00:00
Show filename if selected
This commit is contained in:
parent
a1c555847d
commit
c47b246b80
@ -81,3 +81,9 @@ div {
|
||||
width: 98%;
|
||||
margin: 1%
|
||||
}
|
||||
|
||||
#uploadFile {
|
||||
text-align: center;
|
||||
font-family: rawengulk-sans;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
@ -9,10 +9,17 @@
|
||||
enctype = "multipart/form-data">
|
||||
<div class="fileUpload btn">
|
||||
<span>Upload</span>
|
||||
<input class="upload btn" type = "file" name = "file" />
|
||||
<input id="uploadBtn" class="upload btn" type="file" name="file" />
|
||||
</div>
|
||||
<p id="uploadFile"></p>
|
||||
<input class="btn" type = "submit"/>
|
||||
</form>
|
||||
<script>
|
||||
document.getElementById("uploadBtn").onchange = function () {
|
||||
filename = document.getElementById('uploadBtn').value.split('C:\\fakepath\\')[1];
|
||||
document.getElementById("uploadFile").innerHTML= filename;
|
||||
};
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user