<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Updated: Upload multiple files with a single file element</title>
	<atom:link href="http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/feed/" rel="self" type="application/rss+xml" />
	<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/</link>
	<description>Random developer notes</description>
	<lastBuildDate>Thu, 14 Jan 2010 08:40:36 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Kobus Myburgh</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-1048</link>
		<dc:creator>Kobus Myburgh</dc:creator>
		<pubDate>Thu, 24 Jul 2008 20:19:33 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-1048</guid>
		<description>Hi kat,

I had the same problem. I viewed example.html and saw that it includes the script file mootools.js, and after renaming my downloaded mootools script (which had a different name) my example worked fine.

Now if someone would just pretty please share their PHP back-end script for this nifty tool, I&#039;d be a very happy person :-)

Regards,

Kobus</description>
		<content:encoded><![CDATA[<p>Hi kat,</p>
<p>I had the same problem. I viewed example.html and saw that it includes the script file mootools.js, and after renaming my downloaded mootools script (which had a different name) my example worked fine.</p>
<p>Now if someone would just pretty please share their PHP back-end script for this nifty tool, I&#8217;d be a very happy person <img src='http://the-stickman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Regards,</p>
<p>Kobus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kobus Myburgh</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-1047</link>
		<dc:creator>Kobus Myburgh</dc:creator>
		<pubDate>Thu, 24 Jul 2008 20:15:01 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-1047</guid>
		<description>Hi,

Did anyone every write a complete PHP back-end script for this wonderful utility? I am a JavaScript klutz, so I don&#039;t even know how to link this with a PHP script...?

Regards,

Kobus</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Did anyone every write a complete PHP back-end script for this wonderful utility? I am a JavaScript klutz, so I don&#8217;t even know how to link this with a PHP script&#8230;?</p>
<p>Regards,</p>
<p>Kobus</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kat</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-1031</link>
		<dc:creator>kat</dc:creator>
		<pubDate>Fri, 18 Jul 2008 10:26:37 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-1031</guid>
		<description>Hi,

I&#039;ve downloaded your script, downloaded mootools 1.2, tried implementing it and no go.
I click Browse, select the file and nothing.  Just goes back to having the filename in the input element.
I ended up just using the example.html to see if some of my other code was conflicting and it still doesn&#039;t work.
I&#039;m not very good with javascript so forgive me if I&#039;m missing something plainly obvious.
any help?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;ve downloaded your script, downloaded mootools 1.2, tried implementing it and no go.<br />
I click Browse, select the file and nothing.  Just goes back to having the filename in the input element.<br />
I ended up just using the example.html to see if some of my other code was conflicting and it still doesn&#8217;t work.<br />
I&#8217;m not very good with javascript so forgive me if I&#8217;m missing something plainly obvious.<br />
any help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JustSomeGuy</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-659</link>
		<dc:creator>JustSomeGuy</dc:creator>
		<pubDate>Fri, 29 Feb 2008 22:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-659</guid>
		<description>We modified this script for our application where we need to create more than one file list on the same page.

Call it like this:

&lt;!-- Create an instance of the multiSelector class, pass it the output target and the max number of files --&gt;
	var multi_selector = new MultiSelector( document.getElementById( &#039;files_list&#039;),&#039;thefirstone&#039; , 10 );
	&lt;!-- Pass in the file element --&gt;
	multi_selector.addElement( document.getElementById( &#039;my_file_element&#039; ));
	&lt;!-- Create an instance of the multiSelector class, pass it the output target and the max number of files --&gt;
	var multi_selector = new MultiSelector( document.getElementById( &#039;files_list2&#039; ),&#039;thesecondone&#039;, 10 );
	&lt;!-- Pass in the file element --&gt;
	multi_selector.addElement( document.getElementById( &#039;my_file_element2&#039;));






/**
 * Convert a single file-input element into a &#039;multiple&#039; input list
 *
 * Usage:
 *
 *   1. Create a file input element (no name)
 *      eg.
 *
 *   2. Create a DIV for the output to be written to
 *      eg.
 *
 *   3. Instantiate a MultiSelector object, passing in the DIV and an (optional) maximum number of files
 *      eg. var multi_selector = new MultiSelector( document.getElementById( &#039;files_list&#039; ), 3 );
 *
 *   4. Add the first element
 *      eg. multi_selector.addElement( document.getElementById( &#039;first_file_element&#039; ) );
 *
 *   5. That&#039;s it.
 *
 *   You might (will) want to play around with the addListRow() method to make the output prettier.
 *
 *   You might also want to change the line
 *       element.name = &#039;file_&#039; + this.count;
 *   ...to a naming convention that makes more sense to you.
 *
 * Licence:
 *   Use this however/wherever you like, just don&#039;t blame me if it breaks anything.
 *
 * Credit:
 *   If you&#039;re nice, you&#039;ll leave this bit:
 *
 *   Class by Stickman -- http://www.the-stickman.com
 *      with thanks to:
 *      [for Safari fixes]
 *         Luis Torrefranca -- http://www.law.pitt.edu
 *         and
 *         Shawn Parker &amp; John Pennypacker -- http://www.fuzzycoconut.com
 *      [for duplicate name bug]
 *         &#039;neal&#039;
 */
function MultiSelector( list_target, output_filename, max ){

	var output_filename = output_filename;
	// Where to write the list
	this.list_target = list_target;
	// How many elements?
	this.count = 0;
	// How many elements?
	this.id = 0;
	// Is there a maximum?
	if( max ){
		this.max = max;
	} else {
		this.max = -1;
	};

	/**
	 * Add a new file input element
	 */
	this.addElement = function( element ){

		// Make sure it&#039;s a file input element
		if( element.tagName == &#039;INPUT&#039; &amp;&amp; element.type == &#039;file&#039; ){

			// Element name -- what number am I?
			element.name = output_filename + &#039;_&#039; + this.id++;

			// Add reference to this object
			element.multi_selector = this;

			// What to do when a file is selected
			element.onchange = function(){

				// New file input
				var new_element = document.createElement( &#039;input&#039; );
				new_element.type = &#039;file&#039;;

				// Add new element
				this.parentNode.insertBefore( new_element, this );

				// Apply &#039;update&#039; to element
				this.multi_selector.addElement( new_element );

				// Update list
				this.multi_selector.addListRow( this );

				// Hide this: we can&#039;t use display:none because Safari doesn&#039;t like it
				this.style.position = &#039;absolute&#039;;
				this.style.left = &#039;-1000px&#039;;

			};
			// If we&#039;ve reached maximum number, disable input element
			if( this.max != -1 &amp;&amp; this.count &gt;= this.max ){
				element.disabled = true;
			};

			// File element counter
			this.count++;
			// Most recent element
			this.current_element = element;

		} else {
			// This can only be applied to file input elements!
			alert( &#039;Error: not a file input element&#039; );
		};

	};

	/**
	 * Add a new row to the list of files
	 */
	this.addListRow = function( element ){

		// Row div
		var new_row = document.createElement( &#039;div&#039; );

		// Delete button
		var new_row_button = document.createElement( &#039;input&#039; );
		new_row_button.type = &#039;button&#039;;
		new_row_button.value = &#039;Delete&#039;;

		// References
		new_row.element = element;

		// Delete function
		new_row_button.onclick= function(){

			// Remove element from form
			this.parentNode.element.parentNode.removeChild( this.parentNode.element );

			// Remove this row from the list
			this.parentNode.parentNode.removeChild( this.parentNode );

			// Decrement counter
			this.parentNode.element.multi_selector.count--;

			// Re-enable input element (if it&#039;s disabled)
			this.parentNode.element.multi_selector.current_element.disabled = false;

			// Appease Safari
			//    without it Safari wants to reload the browser window
			//    which nixes your already queued uploads
			return false;
		};

		// Set row value
		new_row.innerHTML = element.value;

		// Add button
		new_row.appendChild( new_row_button );

		// Add it to the list
		this.list_target.appendChild( new_row );

	};

};</description>
		<content:encoded><![CDATA[<p>We modified this script for our application where we need to create more than one file list on the same page.</p>
<p>Call it like this:</p>
<p><!-- Create an instance of the multiSelector class, pass it the output target and the max number of files --><br />
	var multi_selector = new MultiSelector( document.getElementById( &#8216;files_list&#8217;),&#8217;thefirstone&#8217; , 10 );<br />
	<!-- Pass in the file element --><br />
	multi_selector.addElement( document.getElementById( &#8216;my_file_element&#8217; ));<br />
	<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files --><br />
	var multi_selector = new MultiSelector( document.getElementById( &#8216;files_list2&#8242; ),&#8217;thesecondone&#8217;, 10 );<br />
	<!-- Pass in the file element --><br />
	multi_selector.addElement( document.getElementById( &#8216;my_file_element2&#8242;));</p>
<p>/**<br />
 * Convert a single file-input element into a &#8216;multiple&#8217; input list<br />
 *<br />
 * Usage:<br />
 *<br />
 *   1. Create a file input element (no name)<br />
 *      eg.<br />
 *<br />
 *   2. Create a DIV for the output to be written to<br />
 *      eg.<br />
 *<br />
 *   3. Instantiate a MultiSelector object, passing in the DIV and an (optional) maximum number of files<br />
 *      eg. var multi_selector = new MultiSelector( document.getElementById( &#8216;files_list&#8217; ), 3 );<br />
 *<br />
 *   4. Add the first element<br />
 *      eg. multi_selector.addElement( document.getElementById( &#8216;first_file_element&#8217; ) );<br />
 *<br />
 *   5. That&#8217;s it.<br />
 *<br />
 *   You might (will) want to play around with the addListRow() method to make the output prettier.<br />
 *<br />
 *   You might also want to change the line<br />
 *       element.name = &#8216;file_&#8217; + this.count;<br />
 *   &#8230;to a naming convention that makes more sense to you.<br />
 *<br />
 * Licence:<br />
 *   Use this however/wherever you like, just don&#8217;t blame me if it breaks anything.<br />
 *<br />
 * Credit:<br />
 *   If you&#8217;re nice, you&#8217;ll leave this bit:<br />
 *<br />
 *   Class by Stickman &#8212; <a href="http://www.the-stickman.com" rel="nofollow">http://www.the-stickman.com</a><br />
 *      with thanks to:<br />
 *      [for Safari fixes]<br />
 *         Luis Torrefranca &#8212; <a href="http://www.law.pitt.edu" rel="nofollow">http://www.law.pitt.edu</a><br />
 *         and<br />
 *         Shawn Parker &amp; John Pennypacker &#8212; <a href="http://www.fuzzycoconut.com" rel="nofollow">http://www.fuzzycoconut.com</a><br />
 *      [for duplicate name bug]<br />
 *         &#8216;neal&#8217;<br />
 */<br />
function MultiSelector( list_target, output_filename, max ){</p>
<p>	var output_filename = output_filename;<br />
	// Where to write the list<br />
	this.list_target = list_target;<br />
	// How many elements?<br />
	this.count = 0;<br />
	// How many elements?<br />
	this.id = 0;<br />
	// Is there a maximum?<br />
	if( max ){<br />
		this.max = max;<br />
	} else {<br />
		this.max = -1;<br />
	};</p>
<p>	/**<br />
	 * Add a new file input element<br />
	 */<br />
	this.addElement = function( element ){</p>
<p>		// Make sure it&#8217;s a file input element<br />
		if( element.tagName == &#8216;INPUT&#8217; &amp;&amp; element.type == &#8216;file&#8217; ){</p>
<p>			// Element name &#8212; what number am I?<br />
			element.name = output_filename + &#8216;_&#8217; + this.id++;</p>
<p>			// Add reference to this object<br />
			element.multi_selector = this;</p>
<p>			// What to do when a file is selected<br />
			element.onchange = function(){</p>
<p>				// New file input<br />
				var new_element = document.createElement( &#8216;input&#8217; );<br />
				new_element.type = &#8216;file&#8217;;</p>
<p>				// Add new element<br />
				this.parentNode.insertBefore( new_element, this );</p>
<p>				// Apply &#8216;update&#8217; to element<br />
				this.multi_selector.addElement( new_element );</p>
<p>				// Update list<br />
				this.multi_selector.addListRow( this );</p>
<p>				// Hide this: we can&#8217;t use display:none because Safari doesn&#8217;t like it<br />
				this.style.position = &#8216;absolute&#8217;;<br />
				this.style.left = &#8216;-1000px&#8217;;</p>
<p>			};<br />
			// If we&#8217;ve reached maximum number, disable input element<br />
			if( this.max != -1 &amp;&amp; this.count &gt;= this.max ){<br />
				element.disabled = true;<br />
			};</p>
<p>			// File element counter<br />
			this.count++;<br />
			// Most recent element<br />
			this.current_element = element;</p>
<p>		} else {<br />
			// This can only be applied to file input elements!<br />
			alert( &#8216;Error: not a file input element&#8217; );<br />
		};</p>
<p>	};</p>
<p>	/**<br />
	 * Add a new row to the list of files<br />
	 */<br />
	this.addListRow = function( element ){</p>
<p>		// Row div<br />
		var new_row = document.createElement( &#8216;div&#8217; );</p>
<p>		// Delete button<br />
		var new_row_button = document.createElement( &#8216;input&#8217; );<br />
		new_row_button.type = &#8216;button&#8217;;<br />
		new_row_button.value = &#8216;Delete&#8217;;</p>
<p>		// References<br />
		new_row.element = element;</p>
<p>		// Delete function<br />
		new_row_button.onclick= function(){</p>
<p>			// Remove element from form<br />
			this.parentNode.element.parentNode.removeChild( this.parentNode.element );</p>
<p>			// Remove this row from the list<br />
			this.parentNode.parentNode.removeChild( this.parentNode );</p>
<p>			// Decrement counter<br />
			this.parentNode.element.multi_selector.count&#8211;;</p>
<p>			// Re-enable input element (if it&#8217;s disabled)<br />
			this.parentNode.element.multi_selector.current_element.disabled = false;</p>
<p>			// Appease Safari<br />
			//    without it Safari wants to reload the browser window<br />
			//    which nixes your already queued uploads<br />
			return false;<br />
		};</p>
<p>		// Set row value<br />
		new_row.innerHTML = element.value;</p>
<p>		// Add button<br />
		new_row.appendChild( new_row_button );</p>
<p>		// Add it to the list<br />
		this.list_target.appendChild( new_row );</p>
<p>	};</p>
<p>};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dee</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-657</link>
		<dc:creator>Dee</dc:creator>
		<pubDate>Thu, 25 Oct 2007 18:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-657</guid>
		<description>I am trying to integrate this lovely js with this perl cript here:

http://www.muquit.com/muquit/software/upload_pl/upload_pl.html

It seems easy enough, but I keep getting error and more error as I made modification to the above script.  I am learning this the hard way.  It doesn&#039;t help the situation when I am clueless too.

Please help.</description>
		<content:encoded><![CDATA[<p>I am trying to integrate this lovely js with this perl cript here:</p>
<p><a href="http://www.muquit.com/muquit/software/upload_pl/upload_pl.html" rel="nofollow">http://www.muquit.com/muquit/software/upload_pl/upload_pl.html</a></p>
<p>It seems easy enough, but I keep getting error and more error as I made modification to the above script.  I am learning this the hard way.  It doesn&#8217;t help the situation when I am clueless too.</p>
<p>Please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas B</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-655</link>
		<dc:creator>Thomas B</dc:creator>
		<pubDate>Mon, 20 Aug 2007 21:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-655</guid>
		<description>Just to let you know it has stopped working in safari 2 but works fine in safari 3.</description>
		<content:encoded><![CDATA[<p>Just to let you know it has stopped working in safari 2 but works fine in safari 3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-653</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Wed, 27 Jun 2007 01:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-653</guid>
		<description>anyone tried to incorporate this into pl/sql development?
I can&#039;t figure out the input parameter type for the html handler page.
I tried the owa.vc_arr but still doesn&#039;t work.
any help would be appreciated.

Cheers</description>
		<content:encoded><![CDATA[<p>anyone tried to incorporate this into pl/sql development?<br />
I can&#8217;t figure out the input parameter type for the html handler page.<br />
I tried the owa.vc_arr but still doesn&#8217;t work.<br />
any help would be appreciated.</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-656</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sat, 26 May 2007 23:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-656</guid>
		<description>Is it possible to modify this script so it only shows the file name and not entire path?

I tried westons code, as othe rpeople ahve, but something must have gotten broken through posting, even after changing all the quotes to normal quotes his script refuses to function at all. I&#039;d really lvoe to use this script as it&#039;s wicked and you&#039;ve dona an amazing job, I&#039;d just prefer to make the list al little less cluttered.

cheers!</description>
		<content:encoded><![CDATA[<p>Is it possible to modify this script so it only shows the file name and not entire path?</p>
<p>I tried westons code, as othe rpeople ahve, but something must have gotten broken through posting, even after changing all the quotes to normal quotes his script refuses to function at all. I&#8217;d really lvoe to use this script as it&#8217;s wicked and you&#8217;ve dona an amazing job, I&#8217;d just prefer to make the list al little less cluttered.</p>
<p>cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-646</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Fri, 06 Apr 2007 13:12:09 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-646</guid>
		<description>hiya, I tested the upload script with some foreign languages. Arabic and asian type fonts. But he changes the filename to something weird. Is there any way for me to fix this?</description>
		<content:encoded><![CDATA[<p>hiya, I tested the upload script with some foreign languages. Arabic and asian type fonts. But he changes the filename to something weird. Is there any way for me to fix this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: LTSpeed</title>
		<link>http://the-stickman.com/web-development/javascript/updated-upload-multiple-files-with-a-single-file-element/comment-page-2/#comment-651</link>
		<dc:creator>LTSpeed</dc:creator>
		<pubDate>Wed, 04 Apr 2007 12:43:24 +0000</pubDate>
		<guid isPermaLink="false">http://the-stickman.com/?p=19#comment-651</guid>
		<description>I have a 99% working solution with greatly improved formatting/functionality with little effort, but this site won&#039;t let me upload anything of any consequence.  It&#039;s a shame because I&#039;d like to share it and could really use your help in debugging the one remaining issue: it won&#039;t let me delete the ones I pre-populate.

Any ideas why it&#039;s so difficult for some people to post things here?</description>
		<content:encoded><![CDATA[<p>I have a 99% working solution with greatly improved formatting/functionality with little effort, but this site won&#8217;t let me upload anything of any consequence.  It&#8217;s a shame because I&#8217;d like to share it and could really use your help in debugging the one remaining issue: it won&#8217;t let me delete the ones I pre-populate.</p>
<p>Any ideas why it&#8217;s so difficult for some people to post things here?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
