Public feed #891136

Someone

public text v1 · immutable
Raw Edit
·published 2008-02-04 11:55 UTC
rendered paste body
<html>
<title>Verify Upload<title>
<body>
<?php
if (!isset($_POST['Upload'])){
        include('forum_upload.inc');
}
else {  //verify that path/image is not emty
        if ($_FILES['pix']['tmp_name'] == 'none') {
        echo '<p>File did not successfully upload. Check the file size. File must be less than 500K.</p>';
        include('form_upload.inc');
        exit();
        }

        //verify that will be a image type loaded by user
        if (!ereg('image',$_FILES['pix']['type'])) {
        echo '<p>File is not a picture! Please try another file.</p>';
        include('forum_upload.inc');
        exit();
        }

        //else if is OK 
        else {
        $destination = '/var/www/upload/'.$_FILES['pix']['name'];
        $temp_file = $_FILES['pix']['tmp_name'];
        move_uploaded_file($temp_file,$destination);
        echo "<p>The file has successfully uploaded:
        {$_FILES['pix']['name']} ({$_FILES['pix']['size']}) </p>";
        }
}
?>
</body>
</html>