If $_POST and $_FILES are both empty then you've exceeded the maximum post size ini ('post_max_size')
There are several settings in php.ini, including the maximum for an individual file ('upload_max_filesize'), and the maximum for all uploads ('post_max_size'). Make sure those ini settings are set correctly
Be careful of syntax if you hve edited it, it's picky when handling M, K or G (not KB, MB or GB), and don't exceed the bit size of your server, i.e. don't go above 4billion bytes on a 32 bit server.
Other causes of $_FILES being empty, but not $_POST. You don't have enough free space to upload your files, or you don't have permissions ot write to the temp directory. Check /tmp has enough space, and that you can write to it as apache/php user.
$_POST is not empty... permission or lack of free space may not be the case here because when i'm uploading an image in a separate php file where i hav written the similar code for uploading but not of other updates as mention in the above code, my image is uploaded with that separate file. but not with the above code.
There appears nothing wrong with the code (that I can see) and you say other examples work - so server is fine. Is that all your code, then, and not edited? Most likely issue now is that you've edited from your real source to a working version above. Check the enctype exists in the original source, check that you only have one opening <form> element and one 'name="file"' input etc. That's all I can think of. If available publicly (the html part, not the php) can you post a link?
the above code is exactly what i'm running on my server... and the html part is in the above code i hav posted...
Absolutely stumped, then. My only 'last gasp" would be to suggest putting a URL in the "action", but can't see how that would help. So it's what I call "back to first principles" - take a bit of code that works elsewhere on the server, check it works here, then edit one line at a time until you get the code you need. Then compare the difference. Sorry - your code's fine (unless we're both missing it) so really no other suggestion.
It worked when I moved my code on an independent .php file. And when I needed to upload I gave the link to that page in which independent uploading code was written. I don't know the reason behind this but this is how I solved it.