diwakar Posted January 6, 2012 Report Share Posted January 6, 2012 we can upload file to server through move_uploaded_file function of php Quote Link to comment Share on other sites More sharing options...
4bdulmobeen Posted February 15, 2012 Report Share Posted February 15, 2012 we can upload file to server through move_uploaded_file function of php <html> <head> <title>Untitled Document</title> </head> <body> <!-- hi there! you can upload the file to the server using move_uploaded_file() function... consider u have the form like this: --> <div align="center" > <h2>Welcome To Our Site</h2> <p>Lets upload a file for testing purposes</p> <form action="uploadFile.php" method="post" enctype="multipart/form-data" > <input type="file" name="profileImage" /><br> <input type="submit" value="Upload File" /><br> </form> </div> <!-- when u'll click on the Upload File button then the script i.e uploadFile.php specified in action attribute of the above form will perform the task to move the uploaded file to the server... here the code for uploadFile.php $fileName = $_FILES['profileImage']['name'] which is original name of file. $path="C:uploadFiles/images/".$fileName; which is the path where i want to place the uploaded file. move_uploaded_file($_FILES['profileImage']['tmp_name'],$path); here $_FILES['profileImage']['tmp_name'] is the temperory file uploaded on the server.. we wana move it from the that location to our own specified directory/folder... so the function move_uploaded_file() moves the file to the path specified --> </body> </html> 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.
Note: Your post will require moderator approval before it will be visible.