Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Undefined index: file in upload.php

<?php 
    if(isset($_POST['submit'])){
        $name       = $_FILES['file']['name'];  
        $temp_name  = $_FILES['file']['tmp_name'];  
        if(isset($name) and !empty($name)){
            $location = '../uploads/';      
            if(move_uploaded_file($temp_name, $location.$name)){
                echo 'File uploaded successfully';
            }
        } else {
            echo 'You should select a file to upload !!';
        }
    }
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Undefined #file
ADD COMMENT
Topic
Name
7+1 =