Below code will do the fileuploading.
|
<html> <head> <title>File Uploading</title> </head> <body> <form action="fileupload.php" method="post" enctype="multipart/form-data"> <input type="file" name="file" size="50" /> <input type="submit" value="Upload" /> </form> </body> </html> |
we have to add the below function into the fileupload.php bool move_uploaded_file ( string $filename , string $destination ); Fileupload.php
|
<? if(isset($_FILES['Upload'])){ $target = "galleries/".basename($_FILES['file']['name']) ; if(move_uploaded_file($_FILES['file']['tmp_name'],$target)); } ?> |
if you want store other information related to that particular file just use the following supergloabal array $_FILES[‘file’][‘tmp_name’]- the uploaded file in the temporary directory on the… Read More »