<?php
# Check to see if the file is accessible
if ( !isset($_FILES['data']['name']) || $_FILES['data']['name'] == '' ) {
die('No input file specified. Please go back and select a file to upload.');
} // End check for file being set
$max_filesize = 999999;
$filetype = 'text/plain';
$upload_path = '/ngbbs/';
# Check to see if the filesize is too large
if ($_FILES['data']['size'] > $max_filesize) {
die('Your filesize is too large. Please make your filesize smaller than ' . $max_filesize . ' bytes.');
} // End if filesize is too large
# Check to see if the filetype is correct
if ($_FILES['data']['type'] != $filetype) {
die('Sorry, your file was not of the ' . $filetype . ' mimetype (yours was ' . $_FILES['data']['type'] . ').');
} // End filetype check
# If file has gotten this far, it is successful
$copy_to = $_SERVER['http://www.leduckaratedo.com/netshoc/upload'] . $upload_path . $_FILES['data']['name'];
# Upload the file
$upload = move_uploaded_file($_FILES['data']['tmp_name'], $copy_to);
# Check to see if upload was successful
if (!$upload) {
die('Sorry, your file could not be uploaded.');
}
echo 'Your file contents are below: <hr>' . file_get_contents($copy_to);
?>