Extension validation
Hi,
I'm using VT to valid extension input, and have created this to testing,
<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php require_once("WA_DigitalFilePro/HelperPHP.php"); ?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFile("WA_UploadResult1", "file", "".((isset($_POST["file"]))?$_POST["file"]:"") ."", "files/", "[FileName]", "2", "[FileName]_[Increment]", "500", "false", "0", "0");
}
?><?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$WAFV_Redirect = "";
$_SESSION['WAVT_index_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateFE(((isset($_POST["file"]))?$_POST["file"]:"") . "",".gif, .jpg, .jpeg, .png",true,1);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"index");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data" name="upload" id="upload">
<label>
<input type="file" name="file" id="perrge" />
</label>
<label>
<input type="submit" name="submit" id="submit" value="Submit" />
</label>
</form>
<p><?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["fileExtension"]; ?></p>
</body>
</html>
But the validation doesn't work and everything gets uploaded, the
<?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["fileExtension"]; ?>
Doesn't work either.
Any ideas?
Thanks in advance.