Advanced Multi Uploader Support Product Page

Upload to variable folder using advanced multi uploader

Asked 17 Dec 2010 00:33:26
2
have this question
17 Dec 2010 00:33:26 Phil Boyle posted:
Hi
I am wanting to use the advanced multi uploader to upload to a variable folder. With Miroslav's help this works perfectly with a single upload. But with the multi it creates the folder and uploads the images but not inside the folder.
The code is below. The session variable comes from another page.

<?php require_once('../ScriptLibrary/cGraphicMediator.php'); ?>
<?php require_once('../ScriptLibrary/incPureUpload.php'); ?>
<?php
session_start();
?>
<?php 
if (isset($_POST['form_var']) && ($_POST['form_var'] != "")){
	$alabala = $_POST['form_var'];
	$_SESSION['alabala'] = $alabala; 
}	
?>
<?php
// Pure PHP Upload 2.1.10
$ppu = new pureFileUpload();
$ppu->path = "gallery/".$_SESSION['alabala'];
$ppu->extensions = "GIF,JPG,JPEG,BMP,PNG";
$ppu->formName = "UploadQueue";
$ppu->storeType = "file";
$ppu->sizeLimit = "";
$ppu->nameConflict = "over";
$ppu->requireUpload = "true";
$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.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("#FFFFFF");
$sipp2->resize(300, 300, true);
$sipp2->overwrite = true;
$sipp2->saveJPEG(70);
$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("#FFFFFF");
$sipp1->resize(100, 100, true);
$sipp1->overwrite = false;
$sipp1->setMask("##path##thumb_##name##.jpg");
$sipp1->saveJPEG(70);
$sipp1->process();
}
?>
<?php
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";
  }
}
?>
<!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>
<title>CMSv3 - keeping your website up to date</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="imagetoolbar" content="false" />
<meta name="Author" content="Phillip Boyle" />
<meta name="" />
<meta name="keywords" content=" " />
<link rel="SHORTCUT ICON" href="i/cms.ico" />
<link rel="stylesheet" type="text/css" href="s/cms.css" />
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="s/ie.css" />

<![endif]-->
<script language='JavaScript' src='../ScriptLibrary/incPureUpload.js' type="text/javascript"></script>

<script language="javascript" type="text/javascript" src="../ScriptLibrary/jquery-latest.pack.js"></script>
<script language="javascript" type="text/javascript" src="../ScriptLibrary/dmxTooltips.js"></script>
<script type="text/javascript">
<!--
function applyDMXTooltip(trigger) {//v1.3
	window.stylesFolderName = 'Styles';
	var arg = {};
	var options = ['dataProvider','showEffect','easing','showAt','showDirection',
	'showDuration','showDelay','closeEvent','styleTheme',
	'showCloseBtn','onshow','onhide','mouseOffsetX','mouseOffsetY','x','y','w','h'];
  for (var i = 0; i < options.length && i < arguments.length-1; i++) {
		arg[options[i]] = arguments[i + 1];
	}
	showTooltip(trigger, arg);
}
//-->
</script>



<script src="../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script language='JavaScript' src='../ScriptLibrary/incPureUpload.js' type="text/javascript"></script>
<script language='JavaScript' src='../ScriptLibrary/incPureUpload.js' type="text/javascript"></script>
</head>

<body>

<script language="JavaScript1.2"></script>

<a name="top"></a>
<div id="pagewrapper">

<div id="title">Rochelle Withell<a class="logout" href="<?php echo $logoutAction ?>">log out</a></div>

<div id="bc">You are here <span class="bcarrow">&nbsp;&raquo;&nbsp;</span><a class="tnav" href="index.php">home</a><span class="bcarrow">&nbsp;&raquo;&nbsp;</span>create client gallery  </div>
<div id="clock">
<script>		
/*Current date script credit: JavaScript Kit (www.javascriptkit.com)*/

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<span class='clock'>[b]"+dayarray[day]+"&nbsp;"+montharray[month]+"&nbsp;"+daym+"&nbsp;"+year+"[/b]</span>")

</script>
</div><!--end of clock-->
<div id="help" onmouseover="applyDMXTooltip(this,'#new_help','slide','linear','lefttop','out',300,10,'never','white',true,'','',0,0,'auto','auto','650','auto')">HELP!</div>
<div >
 
<div id="pnav">
  <ul id="MenuBar1" class="MenuBarVertical">[*]<a class="MenuBarItem" href="index.php">Home</a>[/*][*]<a class="MenuBarItem" href="#">Create client acct</a>[list][*]<a class="" href="add_client.php">Add client</a>[/*][*]<a class="" href="delete_client.php">Delete client</a>[/*][*]<a class="" href="edit_client.php">Edit client</a>[/*][/list]
    [/*][*]<a class="MenuBarItem" href="#">Create  gallery</a>[list][*]<a class="" href="add_photo_gallery.php">Create photo gallery</a>[/*][*]<a class="" href="delete_photo_gallery.php">Delete single photo</a>[/*][*]<a class="" href="edit_photo_gallery.php">Edit photo_gallery</a>[/*][/list][/*][*]<a class="MenuBarItem" href="#">Administrator</a>[list][*]<a class="" href="add_user.php">Add new user</a>[/*][*]<a class="" href="delete_user.php">Delete existing user</a>[/*][*]<a class="" href="edit_user.php">Edit user details</a>[/*][/list]
    [/*][/list]
  </div><!--end of pnav-->
<div id="content">
[h1]CMS create client gallery[/h1]
<div class="leftcolumn"> 


 

  
  
  
   <form action="<?php echo $GP_uploadAction; ?>" method="post" enctype="multipart/form-data" name="UploadQueue" id="UploadQueue" onsubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,'','','','','','','');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',true,'','','','','','','')" />
  <input type="hidden" name="Filedata" />
  <script type="text/javascript">window.upload1 = document.forms["UploadQueue"].upload1;</script>
</form>
</div>
  <!--end of leftcolumn-->
  <div class="rightcolumn">
 
  </div>
  <!--end of rightcolumn-->
  

</div>





</div><!--end of content-->
	
<div id="new_help" >[h2]Help [/h2]
<ol >[*][b]Product introduction[/b] a very brief description of product.[/*][*][b]Product photo[/b]  the large product photo needs to be a rectangle and will be resized to a width of 450px and the thumbnail image will be automatically be created.[/*]

</ol>
   <table border="1" cellpadding="3" cellspacing="0" class="info_help">
    <tr>
    <th colspan="8">Match the info field with product</th>
   
      </tr>
    <tr>
    <th>&nbsp;</th>
    <th>Bikes</th>
    <th>Accessories</th>
    <th>Boats</th>
    <th>Lawnmowers</th>
   <th>Generators</th>
    <th>Waterpumps</th>
    <th>Outboards</th>
      </tr>
           <tr>
     <th>Info1</th>
     <td>Year</td>
      <td>Description</td>
       <td>Length</td>
        <td>Engine</td>
         <td>AC frequency</td>
          <td>Engine</td>
          <td>Engine</td>
          </tr>
           <tr>
     <th>Info2</th>
     <td>Engine</td>
      <td>Material</td>
       <td>Material</td>
        <td>Cutting width</td>
         <td>AC voltage output</td>
          <td>Oil alert</td>
          <td>Full throttle rpm</td>
          </tr>
           <tr>
   <th>Info3</th>
     <td>Compression</td>
      <td>Colour</td>
       <td>Width</td>
        <td>Cutting height</td>
         <td>Max.AC output</td>
          <td>Diameter</td>
          <td>Rated power</td>
          </tr>
           <tr>
   <th>Info4</th>
     <td>Fuel Ind</td>
      <td>Sizes</td>
       <td>Capacity</td>
        <td>Cutting length</td>
         <td>Rated AC output</td>
          <td>Total head</td>
          <td>Cooling system</td>
          </tr>
           <tr>
    <th>Info5</th>
     <td>Ignition</td>
      <td>Weight</td>
       <td>Weight</td>
        <td>Self-propelled</td>
         <td>DC output</td>
          <td>Suction head</td>
          <td>Fuel ind</td>
          </tr>
           <tr>
   <th>Info6</th>
     <td>Gear box</td>
      <td>Warranty</td>
       <td>Options</td>
        <td>Grass catcher</td>
         <td>Continuous usage</td>
          <td>Max pumping</td>
          <td>Ignition</td>
          </tr>
           <tr>
    <th>Info7</th>
     <td>Ground clearance</td>
      <td>----</td>
       <td>----</td>
        <td>Blade type</td>
         <td>Noise level</td>
          <td>Dimensions</td>
          <td>Starter</td>
          </tr>
           <tr>
    <th>Info8</th>
     <td>Fuel capacity</td>
      <td>----</td>
       <td>----</td>
        <td>Fuel capacity</td>
         <td>Weight</td>
          <td>Framed</td>
          <td>Gear ratio</td>
          </tr>
           <tr>
   <th>Info9</th>
     <td>Colour</td>
      <td>----</td>
       <td>----</td>
        <td>Dry weight</td>
         <td>Dimensions</td>
          <td>Weight</td>
          <td>Configuration</td>
          </tr>
    </table>
   
</div>





<div id="tnav"><a class="tnav" href="#top">back to the top</a><br/>

CMSv3. All rights reserved.  site design by <a  class="tnav" href="http://www.trickstar.co.nz">trickstar</a></div>
</div><!--end of pagewrapper-->
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1");
//-->
</script>
</body>
</html>



I tried to use the post about the same issue for asp but no chance.
Your help is appreciated.

Replies

Replied 22 Dec 2010 11:54:37
22 Dec 2010 11:54:37 Miroslav Zografski replied:
Hello Phil,

Will check it and will get back to you.
Meanwhile,
try following:
1. Create a hidden filed inside the form placed by the AMU as follows:
<input type="hidden" id="folder" name="folder" value="<?php echo $alabala;?>"/>

2. Set the $ppu->path to:
$ppu->path = "gallery/".$_POST['folder'];



Regards,

Reply to this topic