File Upload Failing
<p>Alright, I'll try to be as brief as possible :-)</p>

<p>I recently took on a client with previous web development issues. An E-commerce site. While we are planning a completely new site from the ground up, we want to ensure the site is atleast somewhat functional in the meantime. Understandable, right. Well this fellow appears to have attempted to code an ecommerce platform from square one, by himself. Needless to say, there are several holes. All of which can be "sucked up" for the time being, however I am finding difficulty with the "file upload". I'm not absolutely sure, as the files, functions, resources, etc. are scattered all over the server, but I'm fairly positive the code below holds a clue to where this might lie. My eyes are killing me, and I'd appreciate a second set or two that are willing to help me locate this problem. Once the upload is fixed, we can move to work on the new site.</p>

<pre><code>&lt;script&gt;
window.onload = processBar;
var xmlHttp;
var xmlHttp1;
var __readout;
var end_process = false;
function ProcessBar()
{
    lock();

    lastReadout = "Uploading file...";
    document.getElementById("ProcessResult").value = lastReadout+'&lt;br&gt;';
    process();
    __readout = setInterval("readout()",200);
}
function Process()
{
    xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP"); 
    xmlHttp1.Open("GET", "http://&lt;!--{$smarty.server.HTTP_HOST}--&gt;/admin/ShopCatalogImport/Process.tpl", true);
    xmlHttp1.onreadystatechange = function() 
    {
        if (xmlHttp1.readyState == 4)
        {
            end_process = true;
            clearInterval(__readout);
            readout();
            //document.getElementById("ProcessResult").innerHTML += "Please, check inserted data."+'&lt;br&gt;';
            xmlHttp1.Open("GET", "http://&lt;!--{$smarty.server.HTTP_HOST}--&gt;/admin/ShopCatalogImport/Process.tpl?finish=true", true);
            xmlHttp1.send();
            unlock();
        }   
    }
    xmlHttp1.send();
}
function readout()
{
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    xmlHttp.open("GET", "http://&lt;!--{$smarty.server.HTTP_HOST}--&gt;/ShopCatalogImport/temp/process.txt?id="+Math.random( ), true); 
    xmlHttp.onreadystatechange = function() 
    {
        if (xmlHttp.readyState == 4 &amp;&amp; end_process === false)
        {
            if(xmlHttp.responseText != '')
            {
                document.getElementById("ProcessResult").innerHTML = xmlHttp.responseText+'&lt;br&gt;';
            }   
        }    

    }
    xmlHttp.send(); 
}
function lock()
{
    var div = document.createElement("DIV");
    div.setAttribute("id", "lockelement");
    div.style.position = "absolute";
    div.style.top = "0px";
    div.style.left = "0px";
    div.style.width = "100%";
    div.style.height = "100%";
    div.style.zIndex = 10000;
    if (document.all) //force IE lock the content
    {
        div.style.backgroundColor = "#FFFFFF";
        div.style.filter = "alpha(opacity=0)";
    }
    document.body.appendChild(div);
}

function unlock()
{
    var div = document.getElementById("lockelement");
    if (div)
    {
        div.parentNode.removeChild(div);
    }
}
</code></pre>

<p></p>
