I don't know why this code isn't executing... My only problem is that file is not transferring to my desired folder i.e., uploadedsnaps.. I'm able to fetch all the data such as snap name, its size, its type but file isn't moving to where i want iit to move.,.. please help me .. <form action=prob.php method=POST enctype='multipart/form-data'> <input type='file' name='snap1'><p/> <input type='submit' name='uploadsnaps' value='Upload Snaps'><br/><br/> </form> <?php if($_POST['uploadsnaps']) { $name1 = $_FILES['snap1']['name']; $size1 = $_FILES['snap1']['size']; $type1 = $_FILES['snap1']['type']; $temp1 = $_FILES['snap1']['temp_name']; $error1 = $_FILES['snap1']['error']; [COLOR="Green"] // uploadedsnaps is my forder where i store photos [/COLOR] $location = "uploadedsnaps/$name1"; move_uploaded_file($temp1,$location); } ?> Code (markup):
Typical reasons for inability to transfer file: - Lack of rights to destination directory - Safe mode - There are no designated directory - File with the same name is lock by another application - No space but in this case i think that you should give full path to your file, with disc letter etc.
Could it be that your path is incomplete? When I've had problems like this in the past it turned out I had to spell out the complete path like: $location = "/home/x-user/public_html/uploadedsnaps/$name1";
The problem is fixed.. The main problem was i was using $temp1 = $_FILES['snap1']['temp_name'] Code (markup): instead of $temp1 = $_FILES['snap1']['tmp_name'] Code (markup): Thanx for all your suggestion...