Hi,
your form input name is different, i.e. in the form is name="eligVal"
and you're checking for "eligRev".
Next, don't do that: "isset($_FILES['eligRev']", it's better to do
like this:
if (is_uploaded_file($_FILES['eligVal']['tmp_name']))...
and then check for correct Mime type.
good luck!
On Nov 18, 6:06 pm, Anthony Smith <mrsmi...@hotmail.comwrote:
Quote:
What am I doing wrong? I will show my form and the action page. A csv
file works fine.
>
<form action="/CompRun/index.php?cmd=uploadEligibilityValidation"
method="POST" enctype="multipart/form-data">
<input type = "file" name="eligVal">
<input type="submit" name="submit" value="Submit">
</form>
>
if (isset($_FILES['eligRev'])){
$file = $_FILES['eligRev']['tmp_name'];
$fp = fopen($file , 'r') or die("can't open file");
insertEligibilityRevenueFile($file, $_SESSION["year"], $_SESSION
["qtr"]);
fclose($fp) or die("can't open file");
$msg = "Data successfully uploaded.";
$smarty->assign('msg', $msg);
$smarty->display('uploadEligRev.tpl');
>
}
>
else{
$smarty->assign('next', $_SERVER['PHP_SELF']."?
cmd=uploadEligibilityRevenue");
$smarty->display('uploadEligRev.tpl');
>
}
>
When I upload a xls, it always just goes to the else, when I upload
anything else, I get the result I expected.
>
Am I missing a setting somewhere?