Click here to Skip to main content
15,867,568 members
Articles / Web Development
Tip/Trick

PHP SimpleSix Uploader

Rate me:
Please Sign up or sign in to vote.
4.60/5 (9 votes)
9 Apr 2012CPOL 17.3K   520   8   4
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)


Written By
CEO Graphsix Studio
Albania Albania
CEO / Web & App Developer @ Graphsix Studio.
Studying Computer Engineering @ Faculty of Electrical and Computer Engineering, UP.

Comments and Discussions

 
AnswerManuel Pin
Member 114252273-Feb-15 18:39
Member 114252273-Feb-15 18:39 
Questionmake more simpler Pin
mukunda panchal14-Nov-12 7:45
mukunda panchal14-Nov-12 7:45 
GeneralMy vote of 5 Pin
noli kollqaku22-May-12 2:47
noli kollqaku22-May-12 2:47 
GeneralMy vote of 2 Pin
semaphore16-May-12 22:37
semaphore16-May-12 22:37 
it doesn't work !!!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.