manishrestha529 Posted July 16, 2012 Share Posted July 16, 2012 form.php <form enctype="multipart/form-data" action="uploader.php" method="post"> <b>Upload Profile picture:</b> <input name="file" type="file" /> <input type="submit" value="Upload" /> </form> uploader.php <?php $target_path = "images/"; $target_file = $target_path . $_FILES['file']['name']; if(move_uploaded_file($_FILES['file']['temp_name'], $target_file)) { echo "Picture Uploaded!"; } else { echo "Error!"; } ?> Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 16, 2012 Share Posted July 16, 2012 I'm sure it's working perfectly. 1. Use forum code tags. 2. Post desired functionality not *just* a bunch of code that you copied from the internet 3. Post what happens when you use it. You most likely need to change the permissions on your folder, and use a full path for the folder, not just the images/ part. Quote Link to comment Share on other sites More sharing options...
PaulRyan Posted July 16, 2012 Share Posted July 16, 2012 This bit: $_FILES['file']['temp_name'] Should infact be: $_FILES['file']['tmp_name'] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.