Advanced Multi Uploader Support Product Page

Upload failure: an error has occurred

Asked 21 Jan 2010 09:15:29
1
has this question
21 Jan 2010 09:15:29 Heather V posted:
I'm having trouble with in image that is within the file size specs for uploading and it is able to be viewed in any photo editor or browser, but when trying to upload the file in AMU, it says "100%, failed, an error has occurred". I tried renaming the filename (leaving the extension alone), and same problem.

What could be the case?

Replies

Replied 21 Jan 2010 12:55:12
21 Jan 2010 12:55:12 Teodor Kuduschiev replied:
Hello Heather,

As i understand the problem is with only one image? If so, could you please send this image to in order for me to investigate the problem?
Replied 20 Apr 2010 07:55:12
20 Apr 2010 07:55:12 Heather V replied:
Looks like the problem is still an issue. I now have a dozen files that won't upload, and some that do all at the same time, in the same que. I've even tried uploading them one at a time, to no avail.

I've opened up these files in a photo editor and they open up just fine, but they won't upload. All the files are less than 3MB to upload.

I have the latest Flash (not that it would matter if the other photos are uploading just fine).

Don't get me wrong, I love the Uploader, but I wish it work 100% of the time.

Here's the code:

<?php require_once('../../ScriptLibrary/incPureUpload.php'); ?>
<?php require_once('../../ScriptLibrary/cGraphicMediator.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
  session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
  $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
  //to fully log out a visitor we need to clear the session varialbles
  $_SESSION['MM_Username'] = NULL;
  $_SESSION['MM_UserGroup'] = NULL;
  $_SESSION['PrevUrl'] = NULL;
  unset($_SESSION['MM_Username']);
  unset($_SESSION['MM_UserGroup']);
  unset($_SESSION['PrevUrl']);
	
  $logoutGoTo = "../../index.php";
  if ($logoutGoTo) {
    header("Location: $logoutGoTo");
    exit;
  }
}
?>
<?php
if (!isset($_SESSION)) {
  session_start();
}
$MM_authorizedUsers = "y";
$MM_donotCheckaccess = "false";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { 
  // For security, start by assuming the visitor is NOT authorized. 
  $isValid = False; 

  // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. 
  // Therefore, we know that a user is NOT logged in if that Session variable is blank. 
  if (!empty($UserName)) { 
    // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. 
    // Parse the strings into arrays. 
    $arrUsers = Explode(",", $strUsers); 
    $arrGroups = Explode(",", $strGroups); 
    if (in_array($UserName, $arrUsers)) { 
      $isValid = true; 
    } 
    // Or, you may restrict access to only certain users based on their username. 
    if (in_array($UserGroup, $arrGroups)) { 
      $isValid = true; 
    } 
    if (($strUsers == "") && false) { 
      $isValid = true; 
    } 
  } 
  return $isValid; 
}

$MM_restrictGoTo = "../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {   
  $MM_qsChar = "?";
  $MM_referrer = $_SERVER['PHP_SELF'];
  if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
  if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0) 
  $MM_referrer .= "?" . $QUERY_STRING;
  $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
  header("Location: ". $MM_restrictGoTo); 
  exit;
}
?>
<?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;
}
}
?>
<?php
// Pure PHP Upload 2.1.10
$ppu = new pureFileUpload();
$ppu->path = "../../images/gallery";
$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG,gif,jpg,jpeg,bmp,png";
$ppu->formName = "UploadQueue";
$ppu->storeType = "file";
$ppu->sizeLimit = "5000";
$ppu->nameConflict = "uniq";
$ppu->requireUpload = "true";
$ppu->minWidth = "";
$ppu->minHeight = "";
$ppu->maxWidth = "";
$ppu->maxHeight = "";
$ppu->saveWidth = "";
$ppu->saveHeight = "";
$ppu->timeout = "800";
$ppu->progressBar = "";
$ppu->progressWidth = "300";
$ppu->progressHeight = "100";
$ppu->redirectURL = "";
$ppu->checkVersion("2.1.10");
$ppu->doUpload();
?>
<?php
// Smart Image Processor PHP 2.0.7
if (isset($_GET['GP_upload'])) {
$sipp2 = new cGraphicMediator("upload", $ppu, "");
$sipp2->setComponent("Auto");
$sipp2->setMatteColor("#000000");
$sipp2->resize(400, 400, true);
$sipp2->addWatermark("../images/bkgrd/logo.gif", "Center-Center", false, "", "50");
$sipp2->overwrite = true;
$sipp2->saveJPEG(100);
$sipp2->process();
}
?>
<?php
// Smart Image Processor PHP 2.0.7
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
$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_radmin, $radmin);
  $Result1 = mysql_query($insertSQL, $radmin) 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="../style/admin.css" rel="stylesheet" type="text/css" media="screen" />
<link href="../style/form.css" rel="stylesheet" type="text/css" media="screen" />
<script src="../../scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script language='javascript' src='../../ScriptLibrary/incPureUpload.js'></script>
</head>

<body>
<div id="block">
<div style="margin-left: auto; margin-right: auto; width: 500px;"><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,png',true,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','name','upload1','width','500','height','350','align','middle','id','upload1','src','dmxMultiUploader','quality','best','flashvars','url=<?php echo urlencode($GP_uploadAction); ?>&formName=UploadQueue&bgStart=#333333&bgEnd=#970000&allowedExtensions=GIF,JPG,JPEG,BMP,PNG.gif,jpg,jpeg,bmp,png','&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" name="upload1" width="500" height="350" align="middle" id="upload1">
<param name="FlashVars" value="url=<?php echo urlencode($GP_uploadAction); ?>&formName=UploadQueue&bgStart=#333333&bgEnd=#970000&allowedExtensions=GIF,JPG,JPEG,BMP,PNG.gif,jpg,jpeg,bmp,png"&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&bgStart=#333333&bgEnd=#970000&allowedExtensions=GIF,JPG,JPEG,BMP,PNG.gif,jpg,jpeg,bmp,png"&redirectUrl=".$ppu->redirectURL;}?>" wmode="transparent" type="application/x-shockwave-flash" width="500" 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,png',true,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></div>
</div>
</body>
</html>

Reply to this topic