View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

File Extension Checked By VTK2

Thread began 9/27/2009 2:15 pm by Cologne | Last modified 3/03/2010 6:44 pm by Cologne | 2752 views | 6 replies

Cologne

File Extension Checked By VTK2

hi,

i try to check the file extension with VTK2 but it does not work. file-size works. hmmm...

<?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 require_once("WA_SecurityAssist/WA_RandomPassword.php"); ?>
<?php
if (!session_id()) session_start();
if(isset($_POST["button"])) {
$_SESSION["imageName"] = "".WA_RandomPassword(15, true, true, true, "") ."";
}
?>
<?php
if (isset($_POST["button"])) {
$WAFV_Redirect = "";
$_SESSION['WAVT_upload_Errors'] = "";
if ($WAFV_Redirect == "") {
$WAFV_Redirect = $_SERVER["PHP_SELF"];
}
$WAFV_Errors = "";
$WAFV_Errors .= WAValidateFE(((isset($_FILES["image"]))? preg_replace('/^.*\./', '', $_FILES["image"]["name"]) :"") . "",".gif, .jpg, .jpeg, .png",true,1);
$WAFV_Errors .= WAValidateNM(((isset($_FILES["image"]))?$_FILES["image"]["size"]:"") . "",0,250000,0," ,",true,2);

if ($WAFV_Errors != "") {
PostResult($WAFV_Redirect,$WAFV_Errors,"upload");
}
}
?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "upload/",
'FileName' => "".$_SESSION['imageName'] ."",
'DefaultFileName' => "",
'ResizeType' => "2",
'ResizeWidth' => "400",
'ResizeHeight' => "120",
'ResizeFillColor' => "#FFFFFF" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if(isset($_POST["button"])){
WA_DFP_UploadFiles("WA_UploadResult1", "image", "0", "", "false", $WA_UploadResult1_Params);
}
?>
<?php
if($WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == 1){
$WA_Redirect_URL = "upload_finished.php";
$WA_Redirect_KeepQS = false;
if ($WA_Redirect_URL != "") {
if ($WA_Redirect_KeepQS && $WA_Redirect_URL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "") {
$WA_Redirect_URL .= ((strpos($WA_Redirect_URL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_Redirect_URL);
}
}
?>
<!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>upload</title>
</head>

<body>
<form action="" method="post" enctype="multipart/form-data" name="formUpload" id="formUpload">
<label>Bild:
<input type="file" name="image" id="image" />
</label>

<?php
if (ValidatedField('upload','upload')) {
if ((strpos((",".ValidatedField("upload","upload").","), "," . "1" . ",") !== false || "1" == "")) {
if (!(false)) {
?>
<p>Das ist kein Bild</p>
<?php //WAFV_Conditional upload.php upload(1:)
}
}
}?>

<?php
if (ValidatedField('upload','upload')) {
if ((strpos((",".ValidatedField("upload","upload").","), "," . "2" . ",") !== false || "2" == "")) {
if (!(false)) {
?>
<p>Das Bild ist zu groß</p>
<?php //WAFV_Conditional upload.php upload(2:)
}
}
}?>
<p>
<label>
<input type="submit" name="button" id="button" value="Hochladen" />
</label>
</p>
</form>
</body>
</html>



thanks for help,
denis

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...