When is $_FILES created/cleared | Relationship to javascript reloads
<p>I use this line</p>

<pre><code>isset( $_FILES['ufile']['tmp_name'] );
</code></pre>

<p>to test for a file upload.  The issue I'm having is that I can't get the value to "clear".</p>

<p>If I go in and manually type</p>

<pre><code>unset( $_FILES['ufile']['tmp_name'] );
</code></pre>

<p>I can clear it but once I remove it, it is somehow populated by PHP.  There are not actual file uploads in this process.</p>

<p>How can I accurately detect when a file has been uploaded and when the upload script is done.</p>

<p>The reason I ask is because Control Class works off this variable and it recently stopped working.</p>

<p>In javascript I recently changed the way I do reloads and I think this is causing a persistence issue with my PHP variables.</p>

<p>Particularly I went from window.location.href = location....to window.reload()</p>

<pre><code>&lt;?php 

include 'class.Control.php';

$ControlEntryObject = new ControlEntry();

    class ControlEntry
    {
        public function __construct()  
        {   
            if( isset( $_FILES['ufile']['tmp_name'] ) )
            {
                if( ( $_FILES['ufile']['tmp_name']) != '' )
                    {
                    Control::upload( $_FILES['ufile']['type'], $_FILES['ufile']['tmp_name'] );
                    }
                else
                    {
                    Control::reload();
                    }
            }
            else if( isset($_POST['ajax_type']) )
            {
                Control::ajax( $_POST['ajax_type'] );
            }
            else
            {
               Control::reload();
            }
        }
    }
</code></pre>
