Skip to content

Instantly share code, notes, and snippets.

@brucenorton
Created April 10, 2018 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brucenorton/37c771c635e53d55e02a3ab960aa3e85 to your computer and use it in GitHub Desktop.
Save brucenorton/37c771c635e53d55e02a3ab960aa3e85 to your computer and use it in GitHub Desktop.
in-class demo upload.php
<?php
// app/upload.php
echo("this is upload.php");
//let's get the file info and upload it
if (isset($_FILES['fileInput'])) {
echo(', got a file!!' . $_FILES['fileInput']['name']);
if(move_uploaded_file($_FILES['fileInput']['tmp_name'], "../uploads/" . $_FILES['fileInput']['name'])){
echo $_FILES['fileInput']['name']. " OK";
} else {
echo $_FILES['fileInput']['name']. " KO";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment