<?php
if (!function_exists("WADFP_getImageHeight")){
function WADFP_getImageHeight($fileField){
$WA_ImageContentTypes = array("image/gif" => true , "image/jpeg" => true, "image/pjpeg" => true, "image/x-png" => true, "image/png" => true);
$height = -1;
if(isset($fileField) && isset($fileField["tmp_name"]) && isset($fileField["type"]) && isset($WA_ImageContentTypes[$fileField["type"]]) ){
$dimensions = getimagesize($fileField["tmp_name"]);
$height = $dimensions[1];
}
return $height;
}
}
?>
<?php
if (!function_exists("WADFP_getImageWidth")){
function WADFP_getImageWidth($fileField){
$WA_ImageContentTypes = array("image/gif" => true , "image/jpeg" => true, "image/pjpeg" => true, "image/x-png" => true, "image/png" => true);
$width = -1;
if(isset($fileField) && isset($fileField["tmp_name"]) && isset($fileField["type"]) && isset($WA_ImageContentTypes[$fileField["type"]]) ){
$dimensions = getimagesize($fileField["tmp_name"]);
$width = $dimensions[0];
}
return $width;
}
}
?>
<?php require_once("WA_ValidationToolkit/WAVT_Scripts_PHP.php"); ?>
<?php require_once("WA_ValidationToolkit/WAVT_ValidatedForm_PHP.php"); ?>
<?php require_once("webassist/file_manipulation/helperphp.php"); ?>
<?php
if (isset($_POST["button"])) {
$WAFV_Redirect = "tupload.php";
$_SESSION['WAVT_tupload_935_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateRQ(((isset($_FILES["image"]))?$_FILES["image"]["name"]:"") . "",true,1);
$WAFV_Errors .= WAValidateFE(((isset($_FILES["image"]))?$_FILES["image"]["name"]:"") . "",".gif, .jpg, .jpeg, .png",true,2);
$WAFV_Errors .= WAValidateNM(((isset($_FILES["image"]))?$_FILES["image"]["size"]:"") . "",0,250000,"",",.",true,3);
$WAFV_Errors .= WAValidateNM(WADFP_getImageWidth((isset($_FILES["image"]))?$_FILES["image"]:"") . "",50,0,"",",.",true,4);
$WAFV_Errors .= WAValidateNM(WADFP_getImageHeight((isset($_FILES["image"]))?$_FILES["image"]:"") . "",50,0,"",",.",true,5);
if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"tupload_935");
}
}
?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "_upload/",
'FileName' => "[FileName]",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["button"])){
WA_DFP_UploadFiles("WA_UploadResult1", "image", "2", "[NewFileName]_[Increment]", "false", $WA_UploadResult1_Params);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data" id="formUplaod">
<p>Image:
<input type="file" name="image" id="image" />
</p>
<p>
<?php
if (ValidatedField('tupload_935','tupload_935')) {
if ((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
Need an image!
<?php //WAFV_Conditional tupload.php tupload_935(1:)
}
}
}?></p>
<p>
<?php
if (ValidatedField('tupload_935','tupload_935')) {
if ((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "2" . ",") !== false || "2" == "")) {
if (!((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "1" . ",") !== false || "1" == ""))) {
?>
Must be an image!
<?php //WAFV_Conditional tupload.php tupload_935(2:1)
}
}
}?></p>
<p>
<?php
if (ValidatedField('tupload_935','tupload_935')) {
if ((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "3" . ",") !== false || "3" == "")) {
if (!((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "1" . ",") !== false || "1" == "") || (strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "2" . ",") !== false || "2" == ""))) {
?>
File-Size to big!
<?php //WAFV_Conditional tupload.php tupload_935(3:1,2)
}
}
}?></p>
<p>
<?php
if (ValidatedField('tupload_935','tupload_935')) {
if ((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "4" . ",") !== false || "4" == "")) {
if (!((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "1" . ",") !== false || "1" == "") || (strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "2" . ",") !== false || "2" == "") || (strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "3" . ",") !== false || "3" == ""))) {
?>
Width must be over 50px!
<?php //WAFV_Conditional tupload.php tupload_935(4:1,2,3)
}
}
}?></p>
<p>
<?php
if (ValidatedField('tupload_935','tupload_935')) {
if ((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "5" . ",") !== false || "5" == "")) {
if (!((strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "1" . ",") !== false || "1" == "") || (strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "2" . ",") !== false || "2" == "") || (strpos((",".ValidatedField("tupload_935","tupload_935").","), "," . "3" . ",") !== false || "3" == ""))) {
?>
Height must be over 50px!
<?php //WAFV_Conditional tupload.php tupload_935(5:1,2,3)
}
}
}?></p>
<p>
<input type="submit" name="button" id="button" value="upload!" />
</p>
</form>
</body>
</html>