Created
April 10, 2018 21:51
-
-
Save brucenorton/37c771c635e53d55e02a3ab960aa3e85 to your computer and use it in GitHub Desktop.
in-class demo upload.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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