<?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: Flash File Uploader &#8211; File Name Rewrite (v3.1)</title>
	<atom:link href="http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/feed/" rel="self" type="application/rss+xml" />
	<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/</link>
	<description>The Personal Blog of Don Citarella</description>
	<lastBuildDate>Thu, 26 Aug 2010 13:44:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Don</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-30139</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Wed, 27 Aug 2008 18:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-30139</guid>
		<description>Hi Narsil, Thanks for the kind words. You can do a number of things to change the look of the two buttons. You can create movie clips for both the &quot;Browse&quot; and the &quot;upload&quot; button to have them look visually different. When you&#039;re done, just copy the code that&#039;s currently on the old form buttons to the new movieclip buttons, rename the new buttons so they&#039;re the same as the old buttons (upload_btn, browse), and delete the old buttons. 

Or a second option is just changing the highlight/halo of the new buttons so they have a different &quot;glow&quot; around them.

Google search how to create movieclip buttons for your version of flash for the first option. Google how to change halo colors for the second option. Let me know if you have any questions.</description>
		<content:encoded><![CDATA[<p>Hi Narsil, Thanks for the kind words. You can do a number of things to change the look of the two buttons. You can create movie clips for both the &#8220;Browse&#8221; and the &#8220;upload&#8221; button to have them look visually different. When you&#8217;re done, just copy the code that&#8217;s currently on the old form buttons to the new movieclip buttons, rename the new buttons so they&#8217;re the same as the old buttons (upload_btn, browse), and delete the old buttons. </p>
<p>Or a second option is just changing the highlight/halo of the new buttons so they have a different &#8220;glow&#8221; around them.</p>
<p>Google search how to create movieclip buttons for your version of flash for the first option. Google how to change halo colors for the second option. Let me know if you have any questions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narsil</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-29850</link>
		<dc:creator>Narsil</dc:creator>
		<pubDate>Wed, 27 Aug 2008 05:45:09 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-29850</guid>
		<description>Hey Don!
Since I last needed help, I&#039;ve since gotten the flash uploader fully setup and working great! I have one little thing I&#039;d like to be able to do though. I want the Upload button to be a different color than the Browse button.. Looking in the flash, they&#039;re both part of the same &quot;compiled&quot; clip. Really, I have no clue what that means. Would I be better off to just design my own button in flash and set it up in place of the upload button? Or is there an easier way for me to change the color?
Note: I figured out how to change the text easy enough! This is a very well assembled Flash piece!</description>
		<content:encoded><![CDATA[<p>Hey Don!<br />
Since I last needed help, I&#8217;ve since gotten the flash uploader fully setup and working great! I have one little thing I&#8217;d like to be able to do though. I want the Upload button to be a different color than the Browse button.. Looking in the flash, they&#8217;re both part of the same &#8220;compiled&#8221; clip. Really, I have no clue what that means. Would I be better off to just design my own button in flash and set it up in place of the upload button? Or is there an easier way for me to change the color?<br />
Note: I figured out how to change the text easy enough! This is a very well assembled Flash piece!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-29655</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Tue, 26 Aug 2008 20:53:08 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-29655</guid>
		<description>You’re absolutely right, Tim. Change the “thumbs” function in the index.php file to look like this:

&lt;tt&gt;	function thumbs()
	{
		var mdir = &#039;&lt;?=(@$dir?&quot;?dir=$dir&quot;:&quot;&quot;)?&gt;&#039;;
		var thumbs = document.getElementById(&#039;thm&#039;);
		if(thumbs.checked == true) { window.location = &quot;index.php&quot;+mdir+&quot;&amp;thm=1&quot;; }
		else { window.location = &quot;index.php&quot;+mdir; }
	}&lt;/tt&gt;

Let me know if you have further issues. Thanks for pointing this to my attention. I’ll revise the .rar later today.</description>
		<content:encoded><![CDATA[<p>You’re absolutely right, Tim. Change the “thumbs” function in the index.php file to look like this:</p>
<p><tt>	function thumbs()<br />
	{<br />
		var mdir = '< ?=(@$dir?"?dir=$dir":"")?>';<br />
		var thumbs = document.getElementById('thm');<br />
		if(thumbs.checked == true) { window.location = "index.php"+mdir+"&#038;thm=1"; }<br />
		else { window.location = "index.php"+mdir; }<br />
	}</tt></p>
<p>Let me know if you have further issues. Thanks for pointing this to my attention. I’ll revise the .rar later today.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim D</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-29617</link>
		<dc:creator>Tim D</dc:creator>
		<pubDate>Tue, 26 Aug 2008 19:34:06 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-29617</guid>
		<description>Don,
Thanks for the quick reply to my questions.  I am afraid I still don&#039;t fully understand how to get where I am going.

To expand a bit on my setup - my flash site loads the index with the actionscript: getURL(&quot;http://www.website.com/uploads/index.php?dir=&quot;+userName); where userName is a flash variable in my case set to &quot;timD&quot;.  This works great, it takes me to the index.php page and allows me to upload files to a new directory &quot;timD&quot; that it creates.  IE list the address of this page as http://www.website.com/uploads/testindex.php?dir=timD.  However when I select the details checkbox, the page is redirected and displays the file info and thumbnails from the default &quot;files&quot; directory not the newly created custom directory.  The address changes to http://www.website.com/uploads/index.php?thm=1.  It seems to my novice eye that when the checkbox calls the javascript thumbs function it somehow loses my $dir variable and resets it to the default &quot;files&quot; value.  I tried modifying the conditional on line 41 to include both the thm and dir variables but I can seem to get it to pass both to the redirected page.

I am using the latest rar file.  I will check on a different computer at home tonight.  How do I know if my browser allows for header.location redirects?

Thanks again for the great code and your help up to this point.</description>
		<content:encoded><![CDATA[<p>Don,<br />
Thanks for the quick reply to my questions.  I am afraid I still don&#8217;t fully understand how to get where I am going.</p>
<p>To expand a bit on my setup &#8211; my flash site loads the index with the actionscript: getURL(&#8220;http://www.website.com/uploads/index.php?dir=&#8221;+userName); where userName is a flash variable in my case set to &#8220;timD&#8221;.  This works great, it takes me to the index.php page and allows me to upload files to a new directory &#8220;timD&#8221; that it creates.  IE list the address of this page as <a href="http://www.website.com/uploads/testindex.php?dir=timD" rel="nofollow">http://www.website.com/uploads/testindex.php?dir=timD</a>.  However when I select the details checkbox, the page is redirected and displays the file info and thumbnails from the default &#8220;files&#8221; directory not the newly created custom directory.  The address changes to <a href="http://www.website.com/uploads/index.php?thm=1" rel="nofollow">http://www.website.com/uploads/index.php?thm=1</a>.  It seems to my novice eye that when the checkbox calls the javascript thumbs function it somehow loses my $dir variable and resets it to the default &#8220;files&#8221; value.  I tried modifying the conditional on line 41 to include both the thm and dir variables but I can seem to get it to pass both to the redirected page.</p>
<p>I am using the latest rar file.  I will check on a different computer at home tonight.  How do I know if my browser allows for header.location redirects?</p>
<p>Thanks again for the great code and your help up to this point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-29574</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Tue, 26 Aug 2008 17:45:56 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-29574</guid>
		<description>Hi Tim, Good question. Sorry I wasn&#039;t too clear in the instructions. When you&#039;re enabling users to create custom directories for uploaded files (as in using the username in your example), you&#039;ll need to ensure that the &amp;dir=[username] is included in your address string at all times. This is for when the upload occurs and after the upload is complete.

For instance, if my upload index.php is here:
http://www.foo.com/?dir=bar

(where &quot;bar&quot; is the username in your example)

You&#039;ll need to redirect using the PHP to return that variable from the GET string. So your final address will be, ignoring the line breaks:
http://www.foo.com/index.php?name=[uploaded file name]
&amp;size=[uploaded file size]
&amp;type=[uploaded file type]
&amp;exts=[valid file types list]
&amp;dir=bar (this is the username)

The default .rar file with custom directories option enables for PHP to perform this redirect. If you&#039;re using the correct .rar (which is located here:
http://don.citarella.net/index.php/2008/04/28/flash-file-uploader-v30-custom-upload-directories/)

Then, you should be good. Check to ensure your browser allows for PHP header.location redirects or try from a different computer/browser. If this doesn&#039;t work, shoot me a link and I&#039;ll take a look.

Don</description>
		<content:encoded><![CDATA[<p>Hi Tim, Good question. Sorry I wasn&#8217;t too clear in the instructions. When you&#8217;re enabling users to create custom directories for uploaded files (as in using the username in your example), you&#8217;ll need to ensure that the &#038;dir=[username] is included in your address string at all times. This is for when the upload occurs and after the upload is complete.</p>
<p>For instance, if my upload index.php is here:<br />
<a href="http://www.foo.com/?dir=bar" rel="nofollow">http://www.foo.com/?dir=bar</a></p>
<p>(where &#8220;bar&#8221; is the username in your example)</p>
<p>You&#8217;ll need to redirect using the PHP to return that variable from the GET string. So your final address will be, ignoring the line breaks:<br />
<a href="http://www.foo.com/index.php?name=uploaded" rel="nofollow">http://www.foo.com/index.php?name=uploaded</a> file name]<br />
&#038;size=[uploaded file size]<br />
&#038;type=[uploaded file type]<br />
&#038;exts=[valid file types list]<br />
&#038;dir=bar (this is the username)</p>
<p>The default .rar file with custom directories option enables for PHP to perform this redirect. If you&#8217;re using the correct .rar (which is located here:<br />
<a href="http://don.citarella.net/index.php/2008/04/28/flash-file-uploader-v30-custom-upload-directories/)" rel="nofollow">http://don.citarella.net/index.php/2008/04/28/flash-file-uploader-v30-custom-upload-directories/)</a></p>
<p>Then, you should be good. Check to ensure your browser allows for PHP header.location redirects or try from a different computer/browser. If this doesn&#8217;t work, shoot me a link and I&#8217;ll take a look.</p>
<p>Don</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim D</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-29554</link>
		<dc:creator>Tim D</dc:creator>
		<pubDate>Tue, 26 Aug 2008 16:48:40 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-29554</guid>
		<description>Don,
Thanks for the great uploader it&#039;s been a huge help.  I am running into one problem though thats is undoubtedly due to my inexperience.  I have a Flash website that I use to call your index.php.  The idea is that you set up a username on the site and this is passed to the index.php file and becomes the directory name where the users uploads are stored.  All that is working great.  The problem is when I check the &quot;details&quot; checkbox the page displays the images from default &quot;files&quot; directory and not from the custom &quot;username&quot; directory.  I know Flash moderately well but am a complete novice in PHP and Java so I am sure I am missing something obvious.  Any help you could offer would be appreciated.  Thanks.</description>
		<content:encoded><![CDATA[<p>Don,<br />
Thanks for the great uploader it&#8217;s been a huge help.  I am running into one problem though thats is undoubtedly due to my inexperience.  I have a Flash website that I use to call your index.php.  The idea is that you set up a username on the site and this is passed to the index.php file and becomes the directory name where the users uploads are stored.  All that is working great.  The problem is when I check the &#8220;details&#8221; checkbox the page displays the images from default &#8220;files&#8221; directory and not from the custom &#8220;username&#8221; directory.  I know Flash moderately well but am a complete novice in PHP and Java so I am sure I am missing something obvious.  Any help you could offer would be appreciated.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-25808</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Tue, 19 Aug 2008 07:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-25808</guid>
		<description>Hi Narsil,

Sorry I didn&#039;t see this sooner, I would&#039;ve been happy to send you the modified FLA. Glad you got it working though. Let me know if you need anything else.</description>
		<content:encoded><![CDATA[<p>Hi Narsil,</p>
<p>Sorry I didn&#8217;t see this sooner, I would&#8217;ve been happy to send you the modified FLA. Glad you got it working though. Let me know if you need anything else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narsil</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-25620</link>
		<dc:creator>Narsil</dc:creator>
		<pubDate>Mon, 18 Aug 2008 22:11:11 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-25620</guid>
		<description>Hey Don, I went ahead and downloaded the demo of Flash CS3 and made the necessary edit. Thanks!! I love this thing. :)</description>
		<content:encoded><![CDATA[<p>Hey Don, I went ahead and downloaded the demo of Flash CS3 and made the necessary edit. Thanks!! I love this thing. <img src='http://don.citarella.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Narsil</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-25604</link>
		<dc:creator>Narsil</dc:creator>
		<pubDate>Mon, 18 Aug 2008 21:33:21 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-25604</guid>
		<description>Don,
Regarding the &quot;All Files&quot; capable upload.. The way I am going to be implementing the Flash File Uploader, the user will not be able to execute anything they upload. The files are going into a non-http accessible directory, so that is of little concern to me. (In reality, I&#039;m using this as a front to an FTP transfer) Also, everyone will log in prior to seeing the uploader.  All around, I&#039;m not too concerned about the security hole there, however, I *do* understand that that is a major security risk. 

If I had flash and could change which files are able to be uploaded through that myself, I would certainly do the checking there. However, as I do not have flash, I have elected to do file type checking in PHP, after the file has been uploaded. Regardless of the security risk that will open up, I believe I will still be okay in this particular instance.  However, Thank you for pointing out the risks involved. It&#039;s always better to see them now instead of when someone takes advantage of the security hole. :)

Should I download a demo of Flash CS3 and try and make the edit myself?</description>
		<content:encoded><![CDATA[<p>Don,<br />
Regarding the &#8220;All Files&#8221; capable upload.. The way I am going to be implementing the Flash File Uploader, the user will not be able to execute anything they upload. The files are going into a non-http accessible directory, so that is of little concern to me. (In reality, I&#8217;m using this as a front to an FTP transfer) Also, everyone will log in prior to seeing the uploader.  All around, I&#8217;m not too concerned about the security hole there, however, I *do* understand that that is a major security risk. </p>
<p>If I had flash and could change which files are able to be uploaded through that myself, I would certainly do the checking there. However, as I do not have flash, I have elected to do file type checking in PHP, after the file has been uploaded. Regardless of the security risk that will open up, I believe I will still be okay in this particular instance.  However, Thank you for pointing out the risks involved. It&#8217;s always better to see them now instead of when someone takes advantage of the security hole. <img src='http://don.citarella.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Should I download a demo of Flash CS3 and try and make the edit myself?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://don.citarella.net/2008/05/30/flash-file-uploader-file-name-rewrite-v31/comment-page-1/#comment-25531</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Mon, 18 Aug 2008 18:09:30 +0000</pubDate>
		<guid isPermaLink="false">http://don.citarella.net/index.php/2008/05/30/flash-file-uploader-file-name-rewrite-v31/#comment-25531</guid>
		<description>Hi Narsil, Glad you got it fixed. A 403 error (forbidden) means you&#039;re attempting to perform a task that is not allowed by the server. Perhaps your host changed something. To investigate, you can check the server error logs to see what was denied before, and what is allowed now. The webserver configuration should be set to allowing file uploads, specific filetypes, upload/post max limits, memory limits, etc. Traditionally, this is allowed by default installation and the only thing you need to do is make the upload directories writeable. That said, there are hosts that limit some of these basic permissions in the name of security. But, as long as it&#039;s fixed, no reason to investigate further (just keep your fingers crossed).

Now, about the ability to upload any file type, we&#039;d need to create one that has an *.* filetype in the flash (All Files) and modify the PHP type checker to allow anything to pass through. This may be as simple as commenting the whole PHP type checker out. That said, you should be aware that you&#039;re opening a sizeable security hole by allowing this as files that are uploaded are immediately accessible by users -- whether they&#039;re viruses or not. Most admin sections could/should still limit the file types to those that are foreseeable as valid. You can always modify the uploader later if users ask for more file types, but I&#039;d still recommend keeping it limited to start. Is this possible?</description>
		<content:encoded><![CDATA[<p>Hi Narsil, Glad you got it fixed. A 403 error (forbidden) means you&#8217;re attempting to perform a task that is not allowed by the server. Perhaps your host changed something. To investigate, you can check the server error logs to see what was denied before, and what is allowed now. The webserver configuration should be set to allowing file uploads, specific filetypes, upload/post max limits, memory limits, etc. Traditionally, this is allowed by default installation and the only thing you need to do is make the upload directories writeable. That said, there are hosts that limit some of these basic permissions in the name of security. But, as long as it&#8217;s fixed, no reason to investigate further (just keep your fingers crossed).</p>
<p>Now, about the ability to upload any file type, we&#8217;d need to create one that has an *.* filetype in the flash (All Files) and modify the PHP type checker to allow anything to pass through. This may be as simple as commenting the whole PHP type checker out. That said, you should be aware that you&#8217;re opening a sizeable security hole by allowing this as files that are uploaded are immediately accessible by users &#8212; whether they&#8217;re viruses or not. Most admin sections could/should still limit the file types to those that are foreseeable as valid. You can always modify the uploader later if users ask for more file types, but I&#8217;d still recommend keeping it limited to start. Is this possible?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
