move_uploaded_file how to build a upload directory
<p>I got a easy question, but didn't found answer on Google. I am building an application that will have to run on various servers and I have no idea if it will be installed in root, subdir, or in any other way. Also I don't have idea if it will be installed on IIS, Apache, or other type od server. I have a realy nasty problem. How to build a upload dir that will be always good. That upload dir will be in an application folder, so I have some point to start, but I can't figure it out how to write proper upload dir.</p>

<pre><code>//tried this for first time
$upload_dir = getcwd().'upload/img';
//then tried this
$upload_dir = 'upload/img';
//and tried couple of others, but more lame, so I will not post it...
</code></pre>

<p>The thing is that warning is raised that says failed to open stream: No such file or directory, and another Unable to move $temp_name to 'upload/img'.</p>

<p>Really don't know where is something wrong. I am sure that this is a lame question, but don't know how to do it good.</p>
