Upload button suddenly not working
The upload buttons suddenly stopped working. I thought it was just one form but I tried the other forms that an upload button and they aren't working either.
The upload buttons suddenly stopped working. I thought it was just one form but I tried the other forms that an upload button and they aren't working either.
where they where working before and stopped, i would suspect the server has had file upload disabled recently for some reason.
double check the upload settings in the php.ini to ensure that upload is still enabled.
it may also be a permissions error with the folder that you are uploading to, basically something server side has changed to cause the upload to fail.
on a page that you have upload on, add the following code to turn on error reporting:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
that may help find the problem if it is a permissions error.
No just one upload button..sorry.Please review my code.
mysql_select_db($database_namc, $namc);
$query_WADAboardminutes = "SELECT minID, minDate, minDownload FROM boardminutes ORDER BY minDate ASC";
$WADAboardminutes = mysql_query($query_WADAboardminutes, $namc) or die(mysql_error());
$row_WADAboardminutes = mysql_fetch_assoc($WADAboardminutes);
$totalRows_WADAboardminutes = mysql_num_rows($WADAboardminutes);?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../board/",
'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["Insert_x"])){
WA_DFP_UploadFiles("WA_UploadResult1", "minDownload", "0", "", "false", $WA_UploadResult1_Params);
}
?>
<?php
// WA Application Builder Insert
if ($_SERVER["REQUEST_METHOD"] == "POST") // Trigger
{
$WA_connection = $namc;
$WA_table = "boardminutes";
$WA_sessionName = "boardminutes_minID";
$WA_redirectURL = "boardminutes_Results.php";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
$WA_keepQueryString = true;
$WA_indexField = "minID";
$WA_fieldNamesStr = "minDate|minDownload";
$WA_fieldValuesStr = "".((isset($_POST["minDate"]))?$_POST["minDate"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."";
$WA_columnTypesStr = "',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_namc;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
send the full page so i can see the code in context, just the server behavior doesn't tell the story without seeing the rest.
I have posted the two files. I might not be doing something correct..this one always screws me up.
the code looks correct.
to troubleshot, i'll need you to make a few changes to the page that will output information to help see what is going on:
1) add the following code at line 1 to turn on error reporting:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
2) Disable the insert redirect. change the following code:
$WA_redirectURL = "boardminutes_Results.php";
to:
$WA_redirectURL = "";
3) on the bindings panel, expand the WA Uploaded Files Global Status group and drag the debug info binding to the page just before the </body> tag
4) add this code just before the </body> tag for more info:
<?php
echo("SQL: ".$WA_Sql."");
echo("<pre>");
var_dump($_FILES);
echo("</pre>");
?>
post back the results after trying the upload again.
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
SQL: INSERT INTO `boardminutes` (`minDate`,`minDownload`) VALUES ('','')
array(1) {
["minDownload"]=>
array(5) {
["name"]=>
string(24) "BoardMinutesApproved.pdf"
["type"]=>
string(0) ""
["tmp_name"]=>
string(0) ""
["error"]=>
int(6)
["size"]=>
int(0)
}
}
so the $_FILES var_dump is returning:
array(1) {
["minDownload"]=>
array(5) {
["name"]=>
string(24) "BoardMinutesApproved.pdf"
["type"]=>
string(0) ""
["tmp_name"]=>
string(0) ""
["error"]=>
int(6)
["size"]=>
int(0)
}
in that dump, it is giving error code
["error"]=>
int(6)
according to the file upload manual page:
features.file-upload.errors.php
error code 6 means there is no temp folder specified for uploading.
I have a folder with permissions on the server. Its in a directory that is using security assist. Would that have something to do with it?
I have another upload button working that I built with form builder. Why wouldn't this work? Its on the same server
the error code 6 says the problem is the upload_tmp_dir setting in the php.ini file. you'll need to contact the host.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
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.