Is there anything missing in this file upload script?
<p>I have a file input known as <code>'fileImage'</code> in my form. The form is in a script known as <code>"QandATable2.php"</code> and this file is stored in the <code>"Mobile_App"</code> folder. Also in the <code>"Mobile_App"</code> folder is a php script known as <code>"imageupload.php"</code> where the file uploading occurs and there is also a folder known as <code>"ImageFiles"</code>. What I want to know is that is the document root code below is actually uploading the file to the <code>"ImageFiles"</code> folder below or is it not. Also is there anything I am missing when it comes to uploading a file in the php <code>"imageupload.php"</code> script because nothing is going into the <code>"ImageFiles"</code> folder when I upload a file.</p>

<p>Below is the php script which does the file uploading:</p>

<pre><code>&lt;?php

   $destination_path = str_replace("//", "/", $_SERVER['DOCUMENT_ROOT']."/")."ImageFiles";

   $result = 0;

   $target_path = $destination_path . $_FILES['fileImage']['name'];

   if(move_uploaded_file($_FILES['fileImage']['tmp_name'], $target_path)) {
      $result = 1;
   }

echo $result;   

?&gt;
</code></pre>

<p>($result is a test to see if if it outputs 1 or 0 when uploading a file but it always outputs 0 when I upload a file meaning I don't think I am uploading the file correctly).</p>

<p>Below is the form of the file input if you wish to see it:</p>

<pre><code>var $fileImage = $("&lt;form action='upload.php' method='post' enctype='multipart/form-data' &gt;" + 
"&lt;p&gt;&lt;br/&gt;&lt;label&gt;File: &lt;input name='fileImage' type='file' class='fileImage' /&gt;&lt;/label&gt;&lt;br/&gt;"+
"&lt;label&gt;&lt;input type='submit' name='submitBtn' class='sbtn' value='Upload' /&gt;&lt;/label&gt;&lt;/p&gt;");
</code></pre>
