Advanced Multi Uploader Support Product Page
This topic was archived
Files Are Not Uploading/Filenames not Recording in Dbase Table
Asked 11 Sep 2009 08:40:00
1
has this question
11 Sep 2009 08:40:00 Heather V posted:
I just purchased the Advanced Multi Uploader this evening, and after following the videos, my files do not upload, they do no get resized, they are not copied to the server. Also, my Insert Record Behavior does not forward to another page after upload as instructed. [What does happen: the scrollbars scroll giving the indication that something is being uploaded. But after checking on the server and the database table, nothing has. [v]
Also, the video that instructs how to use the Insert Record Server Behavior and that you must associate the 'filename' with 'FileData', 'FileData' is not selected on the video; 'filename' is. I was confused at that.
I hope someone can help me with this and get me moving forward.
My code:
<?php require_once('../../../Connections/user.php'); ?>
<?php require_once('../../../ScriptLibrary/incPureUpload.php'); ?>
<?php require_once('../../../ScriptLibrary/cGraphicMediator.php'); ?>
<?php
// Pure PHP Upload 2.1.9
$ppu = new pureFileUpload();
$ppu->path = "../../../photogallery";
$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG,gif,jpg,jpeg,bmp";
$ppu->formName = "UploadQueue";
$ppu->storeType = "file";
$ppu->sizeLimit = "5000";
$ppu->nameConflict = "over";
$ppu->requireUpload = "false";
$ppu->minWidth = "";
$ppu->minHeight = "";
$ppu->maxWidth = "";
$ppu->maxHeight = "";
$ppu->saveWidth = "";
$ppu->saveHeight = "";
$ppu->timeout = "600";
$ppu->progressBar = "";
$ppu->progressWidth = "";
$ppu->progressHeight = "";
$ppu->redirectURL = "";
$ppu->checkVersion("2.1.9");
$ppu->doUpload();
?>
<?php
// Smart Image Processor PHP 2.0.6
if (isset($_GET['GP_upload'])) {
$sipp2 = new cGraphicMediator("upload", $ppu, "");
$sipp2->setComponent("Auto");
$sipp2->setMatteColor("#000000");
$sipp2->resize(500, 500, true);
$sipp2->overwrite = true;
$sipp2->saveJPEG(100);
$sipp2->process();
}
?>
<?php
// Smart Image Processor PHP 2.0.6
if (isset($_GET['GP_upload'])) {
$sipp1 = new cGraphicMediator("upload", $ppu, "");
$sipp1->setComponent("Auto");
$sipp1->setMatteColor("#000000");
$sipp1->resize(120, 90, true);
$sipp1->overwrite = false;
$sipp1->setMask("##path##thumbs/##name##.jpg");
$sipp1->saveJPEG(100);
$sipp1->process();
}
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if (isset($editFormAction)) {
if (isset($_SERVER['QUERY_STRING'])) {
if (!eregi("GP_upload=true", $_SERVER['QUERY_STRING'])) {
$editFormAction .= "&GP_upload=true";
}
} else {
$editFormAction .= "?GP_upload=true";
}
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "UploadQueue")) {
$insertSQL = sprintf("INSERT INTO gallery (filename) VALUES (%s)",
GetSQLValueString($_POST['Filedata'], "text"));
mysql_select_db($database_user, $user);
$Result1 = mysql_query($insertSQL, $user) or die(mysql_error());
$insertGoTo = "list.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<!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" />
<link href="../../ccllskkdjf/admin.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="shortcut icon" href="../../../favicon.ico" type="image/x-icon" />
<link rel="icon" href="../../../favicon.ico" type="image/x-icon" />
<script src="../../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script language='javascript' src='../../../ScriptLibrary/incPureUpload.js'></script>
</head>
<body>
<div id="body-center">
<div id="sc-body">
<h1> INSERT - photo gallery file </h1>
<ul>
<li>This form is to insert new images for the photo gallery</li>
<li>File size is limited to 3MB </li>
<li>Existing filenames will be overwritten </li>
<li>If you are updating a photo, return to the <a href="list.php">Photo List</a> and click 'EDIT' next to the image to update</li>
</ul>
<form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="UploadQueue" id="UploadQueue" onsubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,gif,jpg,jpeg,bmp',false,5000,'','','','','','');return document.MM_returnValue">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,63,0','width','550','height','350','id','upload1','align','middle','src','dmxMultiUploader','name','upload1','quality','best','flashvars','url=<?php echo urlencode($GP_uploadAction); ?>&formName=UploadQueue&FlashUpload=true<?php if ($ppu->redirectURL <> '') {echo "&redirectUrl=".$ppu->redirectURL;}?>','wmode','transparent','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','dmxMultiUploader' ); //end AC code
</script><noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,63,0" width="550" height="350" id="upload1" align="middle">
<param name="FlashVars" value="url=<?php echo urlencode($GP_uploadAction); ?>&formName=UploadQueue&FlashUpload=true<?php if ($ppu->redirectURL <> '') {echo "&redirectUrl=".$ppu->redirectURL;}?>" />
<param name="movie" value="dmxMultiUploader.swf" />
<param name="quality" value="best" />
<param name="wmode" value="transparent" />
<embed src="dmxMultiUploader.swf" name="upload1" quality="best" flashvars="url=<?php echo urlencode($GP_uploadAction); ?>&formName=UploadQueue&FlashUpload=true<?php if ($ppu->redirectURL <> '') {echo "&redirectUrl=".$ppu->redirectURL;}?>" wmode="transparent" type="application/x-shockwave-flash" width="550" height="350" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
<input name="Filename" type="file" style="display:none" onchange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG,gif,jpg,jpeg,bmp',false,5000,'','','','','','')" />
<input type="hidden" name="Filedata" />
<script type="text/javascript">window.upload1 = document.forms["UploadQueue"].upload1;</script>
<input type="hidden" name="MM_insert" value="UploadQueue">
</form>
<p class="menu"><a href="../menu.php">Admin Menu</a> <a href="list.php">Photo Gallery List</a> <a href="<?php echo $logoutAction ?>">Log Out</a></p>
</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8647242-4");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>
<?php
mysql_free_result($getCategory);
?>Replies
Replied 11 Sep 2009 09:42:24
11 Sep 2009 09:42:24 Heather V replied:
I've managed to the upload and resize worked out and the Insert Record Server Behavior to work to post to the dbase (do not use any other browser but IE---AMU doesn't work with anything else but IE).
Also, for some reason, my Insert Record Server Behavior redirect does not work. After the upload, the page just sits there.
Also, for some reason, my Insert Record Server Behavior redirect does not work. After the upload, the page just sits there.
Replied 14 Sep 2009 16:32:51
14 Sep 2009 16:32:51 Miroslav Zografski replied:
Hello Heather,
The redirect is a buggy still so we are working on fixing it and hopefully soon will issue an update for AMU.
Remove the redirection and place a button or link so your users can continue.
After removing the redirect it is highly possible that the upload will start working with all browsers.
Regards,
The redirect is a buggy still so we are working on fixing it and hopefully soon will issue an update for AMU.
Remove the redirection and place a button or link so your users can continue.
After removing the redirect it is highly possible that the upload will start working with all browsers.
Regards,

