Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web

PHP SimpleSix Uploader

4.60/5 (9 votes)
9 Apr 2012CPOL 18.2K   520  
A simple file uploader written in PHP.

Introduction

PHP SimpleSix Uploader is a simple file uploader written in PHP, can be used in different modules and it can be designed according to your needs.

Using the code

Here is some of the PHP code:

PHP
<?

    $file = $_FILES['file'];
    $name = $_POST['name'];
    $path = $_POST['path'];
    $upload = $_POST['upload'];

    if(isset($upload)){

        if($file['name']){

            if($name){
                
                if(strlen($path) > 5){

                    move_uploaded_file($file['tmp_name'], $path.$name);
                    echo "<font color=green>File successfully uploaded!</font>";
                
                } else 
                    echo "<li> Please enter the path!";
            
            } else 
                echo "<li> Please put the file name!"; 

        } else 
            echo "<li> No file to upload";

        echo "<br /><hr />";
    }

?>

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)