In PHP there are many ways of handling file uploads. In this chapter we arw giving a simple example of file uploading from a form.

Simple example if file uploading in PHP

<?php
    $dir = "uploads/"; // directory of the file
    $dir2 = "upload_new/"; // directory to upload to
    $file = "example_file.php"; // file to be uploaded
    // uploading script
    move_uploaded_file($dir.$file, $dir2);
?>

 

›› go to examples ››