Upload Files is not working - no errors
Hello,
I recently upgraded to 1.0.7. On a new project I added a form to upload images, like I have on many projects in the past, only this time nothing happens when the form is submitted.
I have added the code to ensure error reporting and uploads debug info is displayed but they are not showing anything either. I created a simple test page to make sure that other code on the page wasn't interfering and the simple page is not working either.
Here is the simple page. Any thoughts?
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
<?php require_once("../webassist/file_manipulation/helperphp.php"); ?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../images/testimg/",
'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["submit"]) || isset($_POST["submit_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "testest", "0", "", "false", $WA_UploadResult1_Params);
}
?>
<?php
if($WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"] == 1){
$WA_Redirect_URL = "temp_upload_test.php?success=1";
$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>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="temp_upload_test.php" enctype="multipart/form-data" name="test" method="post" >
<input name="testest" type="file" />
<input type="submit" name="submit" value="submit" />
</form>
<?php echo WA_DFP_AllUploadsDebug(); ?>
<?php
echo("POST:<pre>");
var_dump($_POST);
echo("</pre>");
echo("FILES:<pre>");
var_dump($_FILES);
echo("</pre>");
?>
</body>
</html>
And the error info:
Status object: WA_UploadResult1
statusCode : 0
errorMessage : No file uploaded
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : -1
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileSize : -1
imageWidth : -1
imageHeight : -1
statusCode : 0
errorMessage : No file uploaded
POST:
array (size=1)
'submit' => string 'submit' (length=6)
FILES:
array (size=1)
'testest' =>
array (size=5)
'name' => string 'Picture002.jpg' (length=15)
'type' => string '' (length=0)
'tmp_name' => string '' (length=0)
'error' => int 1
'size' => int 0
Thanks for your help!
Edit: If I keep trying the form it will randomly work?? Very strange.