Getting complete PATH of uploaded file - PHP
<p>I have a form(HTML, PHP) that lets the end user upload a file to update the database(MySQL) with the records in the uploaded file(specifically .csv). However, in the phpscript, I can only get the filename and not the complete path of the file specificed. fopen() fails due to this reason. Can anyone please let me know how I can work on finding the complete path?</p>

<p>HTML Code:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form method="POST" action="upload.php" enctype="multipart/form-data"&gt;
    &lt;p&gt;File to upload : &lt;input type ="file" name = "UploadFileName"&gt;&lt;/p&gt;&lt;br /&gt;
    &lt;input type = "submit" name = "Submit" value = "Press THIS to upload"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>PHP Script:</p>

<pre><code>&lt;?php
   .....
......
   $handle = fopen($_FILES["UploadFileName"]["name"], "r"); # fopen(test.csv) [function.fopen]: failed to open stream: No such file or directory
?&gt;
</code></pre>
