Current File : /home/inlingua/public_html/sales/upload.php |
<?php
include("header.php");
?>
<script>
function ExtensionsOkayFile() {
var extensionfile = new Array();
var fieldvalue1 = document.getElementById('file_up').value;
extensionfile[0] = ".xls";
//extensionfile[1] = ".xls";
//extensionfile[2] = ".docx";
//
if(fieldvalue1=="")
{
alert("Please upload .csv File as per sample file.");
return false;
}
if(fieldvalue1!="")
{
var thisext1 = fieldvalue1.substr(fieldvalue1.lastIndexOf('.'));
for(var i = 0; i < extensionfile.length; i++) {
if(thisext1 == extensionfile[i]) {
//alert('File Attached');
return true; }
}
alert("Your attached file contains an unapproved file extension.Only (.xls)file extensions are excepted.");
return false;
}
return true;
}
</script>
<table>
<tr><td><b>Upload (.xls)</b></td><form action="readexcel.php" method="POST" enctype="multipart/form-data" onsubmit="return ExtensionsOkayFile();"><td> <input type="hidden" name="MAX_FILE_SIZE" value="500000">
<input type=FILE name="download" size=20 id="file_up" class="inpu"><input type="submit" value="Convert" class="butt" name="submit"></td></form></tr>
<tr><td colspan="2"><a href='Sample.xls' target="_blank">Sample .xls File</a></a></td> </tr>
</table>
<?php
include("footer.php");
?>