I have a html file input control. When user submits the form (after selecting a file), I need to show a confirmation box showing the file names and asking for confirmation.
Here is my HTML
Select zip file :<input type="file" class="file" name="zip_file_import" id="zip_file_import" />
<input type="button" value="Upload" onclick="formSubmit()" class="button-style" />
below is the Javascript
function formSubmit() {
var confirm_message = confirm("Files selected for import are \n Zip File: "+document.getElementById("zip_file_import").value +"\n Manifest File: "+document.getElementById("manifest_file_import").value+" \nDo you want to proceed?");
if (confirm_message==false) {
return false;
}
else {
document.getElementById("import_form").submit();
document.body.style.cursor = "wait";
}
}
}
when the alert message comes up, it show the path of the file as C:\Fakepath\myfile.zip.
Is it possible to get the actual file path? If not can I simply strip the file path and just show the file name?