<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Plupload Forum - Dynamic sub folder - how to?]]></title>
		<link>http://www.plupload.com/punbb/viewtopic.php?id=1049</link>
		<description><![CDATA[The most recent posts in Dynamic sub folder - how to?.]]></description>
		<lastBuildDate>Sat, 25 Feb 2012 10:20:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Dynamic sub folder - how to?]]></title>
			<link>http://www.plupload.com/punbb/viewtopic.php?pid=6360#p6360</link>
			<description><![CDATA[<p>hello,<br />I also have the same need,<br />I use prestashop 1.4.6.2,<br />I would like the files uploaded by clients were appointed by the order number + a consecutive number:<br />(1) (2) (3) etc. ... in case of several files for a single order.</p><p>I just downloaded plupload and I have yet to install it.<br />Since you use it in prestashop you tell me how to install and configure it should?<br />in what folder? , in which position page ?<br />and what parameters to set?</p><p>many thanks<br />Christian</p>]]></description>
			<author><![CDATA[dummy@example.com (jmar@jmar.it)]]></author>
			<pubDate>Sat, 25 Feb 2012 10:20:42 +0000</pubDate>
			<guid>http://www.plupload.com/punbb/viewtopic.php?pid=6360#p6360</guid>
		</item>
		<item>
			<title><![CDATA[Re: Dynamic sub folder - how to?]]></title>
			<link>http://www.plupload.com/punbb/viewtopic.php?pid=4440#p4440</link>
			<description><![CDATA[<p>I needed the same thing on my application. </p><p>You just should define a global javascript variable, then you can use it in plupload scripts.</p><p>1. HTML form and Upload form view file:<br /></p><div class="codebox"><pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
var myvalue = &quot;&lt;?php echo $dynamic_variable ?&gt;&quot;;
&lt;/script&gt;</code></pre></div><br /><p>2. In &quot;jquery.plupload.queue.js&quot;, find </p><div class="codebox"><pre><code> m.append(&#039;&lt;li id=&quot;&#039;+o.id+&#039;&quot;&gt; .... </code></pre></div><p> ... This is where it begins to create rows specific for every file. You can define anything here that is specific to this file. Like, i put a textarea, a hidden input, an a select box. You should give them unique name and id. Here is myexample:</p><div class="codebox"><pre><code>m.append(&#039;&lt;li id=&quot;&#039;+o.id+&#039;&quot;&gt;&lt;div class=&quot;plupload_file_name&quot;&gt;&lt;span&gt;&#039;+o.name+&#039;&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;select name=&quot;album[&#039;+o.id+&#039;]&quot;&gt;&#039;+albumAppend+&#039;&lt;/select&gt;&lt;/div&gt;&lt;span class=&quot;plupload_preview&quot;&gt;&lt;/span&gt;&lt;div class=&quot;plupload_desc&quot;&gt;&lt;img id=&quot;preview_&#039;+o.id+&#039;&quot; src=&quot;&#039;+p_dir+&quot;/&quot;+userFolder+&quot;/&quot;+o.target_name+&#039;&quot; width=&quot;50&quot; height=&quot;50&quot; style=&quot;float: left;&quot;/&gt;&lt;textarea cols=&quot;50&quot; rows=&quot;3&quot; name=&quot;story[&#039;+o.id+&#039;]&quot; style=&quot;margin-left: 10px; width: 300px;&quot;&gt;Story of this photo: [&#039;+o.name+&#039;]&lt;/textarea&gt;&lt;input type=&quot;hidden&quot; name=&quot;fileId[]&quot; value=&quot;&#039;+o.id+&#039;&quot;/&gt;&lt;input type=&quot;hidden&quot; name=&quot;userFolder&quot; value=&quot;&#039;+userFolder+&#039;&quot;/&gt;&lt;input type=&quot;hidden&quot; name=&quot;fileName[&#039;+o.id+&#039;]&quot; value=&quot;&#039;+o.target_name+&#039;&quot;/&gt;&lt;/div&gt;&lt;div class=&quot;plupload_file_action&quot;&gt;&lt;a href=&quot;#&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;plupload_file_status&quot;&gt;&#039;+o.percent+&#039;%&lt;/div&gt;&lt;div class=&quot;plupload_file_size&quot;&gt;&#039;+plupload.formatSize(o.size)+&#039;&lt;/div&gt;&lt;div class=&quot;plupload_clearer&quot;&gt;&amp;nbsp;&lt;/div&gt;&#039;+l+&quot;&lt;/li&gt;&quot;);</code></pre></div><p>In this example of mine, &quot;albumAppend&quot;, &quot;userFolder&quot; variables are produced beforehand as global javascript variables via PHP. (see, step 1)</p><p>Then i give them specific names and ids; like: <br /></p><div class="codebox"><pre><code>&lt;input type=&quot;hidden&quot; value=&quot;&#039;+myClientFolder+&#039;&quot; name=&quot;clientFolder[&#039;+o.id+&#039;]&quot; /&gt;</code></pre></div><p>This way, you can read the POST value in PHP like this:</p><div class="codebox"><pre><code>&lt;?php

$clientFolder = $_POST[&quot;clientFolder&quot;][$id];

?&gt;</code></pre></div><p>What I wrote above is for the &quot;save form&quot; process. For upload, you can send a querystring to the UPLOAD URL:</p><div class="codebox"><pre><code>$(&quot;#uploader&quot;).pluploadQueue({
        // General settings
        runtimes : &#039;gears,flash,silverlight,browserplus,html5&#039;,
        url : &#039;upload.php?folder=&lt;?php echo $myClientFolder; ?&gt;&#039;,
        max_file_size : &#039;10mb&#039;,
        chunk_size : &#039;1mb&#039;,
        unique_names : true,</code></pre></div><p>How does it sound now?</p>]]></description>
			<author><![CDATA[dummy@example.com (oyt)]]></author>
			<pubDate>Wed, 27 Jul 2011 10:31:20 +0000</pubDate>
			<guid>http://www.plupload.com/punbb/viewtopic.php?pid=4440#p4440</guid>
		</item>
		<item>
			<title><![CDATA[Dynamic sub folder - how to?]]></title>
			<link>http://www.plupload.com/punbb/viewtopic.php?pid=4380#p4380</link>
			<description><![CDATA[<p>Hi all!<br />I&#039;ve just coded plupload in my Prestashop site and it works fine. My problem is this: I&#039;ve many clients, and each client has different orders. Plupload must be able to manage uploads for every order. Prestashop assign every order a number_id and I want to use this dynamic number_id for generating my sub folder. In this way I can manage all orders and files uploaded. <br />I&#039;ve tried to use multipart_params to transfer a Javascript variable but it doesn&#039;t work. Someone can help me?</p><p>This is my code</p><p>// Setup flash version<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#flash_uploader&quot;).pluploadQueue({</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // General settings<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; runtimes : &#039;flash&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url : &#039;/themes/Web-To-Print-5/plupload/examples/upload.php&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max_file_size : &#039;10mb&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chunk_size : &#039;1mb&#039;,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unique_names : false, //default set true<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; multi_selection : true,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // PreInit events, bound before any internal events<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //preinit: {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Init: function(up, info) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //log(&#039;[Init]&#039;, &#039;Info:&#039;, info, &#039;Features:&#039;, up.features);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //},<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //UploadFile: function(up, file) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //log(&#039;[UploadFile]&#039;, file);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // You can override settings before the file is uploaded<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // up.settings.url = &#039;upload.php?id=&#039; + file.id;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // up.settings.multipart_params = {param1: &#039;value1&#039;, param2: &#039;value2&#039;};<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //}<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //},</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Multipart for folder generation<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; multipart_params: {subdirname : &quot;sottocartella&quot;}, <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //multipart_params: {subdirname : &quot;&quot;}, //Dynamic Folder??</p><p>How can I set a javascript variable inside multipart_params?</p>]]></description>
			<author><![CDATA[dummy@example.com (halfmount)]]></author>
			<pubDate>Sat, 16 Jul 2011 09:58:53 +0000</pubDate>
			<guid>http://www.plupload.com/punbb/viewtopic.php?pid=4380#p4380</guid>
		</item>
	</channel>
</rss>
