close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Upload button suddenly not working

Thread began 11/01/2012 11:53 am by wbrooks199805 | Last modified 11/05/2012 9:23 am by Jason Byrnes | 3078 views | 11 replies |

wbrooks199805

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.

Sign in to reply to this post

Jason ByrnesWebAssist

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:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>



that may help find the problem if it is a permissions error.

Sign in to reply to this post

wbrooks199805

not on the server

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);
}
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post

wbrooks199805

Thank you Jason

I have posted the two files. I might not be doing something correct..this one always screws me up.

Attached Files
Archive.zip
Sign in to reply to this post

Jason ByrnesWebAssist

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:
<?php

error_reporting
(E_ALL);
ini_set('display_errors','on');
?>




2) Disable the insert redirect. change the following code:

php:
$WA_redirectURL = "boardminutes_Results.php";



to:

php:
$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:
<?php

echo("SQL: ".$WA_Sql."");
echo(
"<pre>");
var_dump($_FILES); 
echo(
"</pre>");
?>




post back the results after trying the upload again.

Sign in to reply to this post

wbrooks199805

results

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)
}
}

Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post

wbrooks199805

weird

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

Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post
loading

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...