Skip to content

Instantly share code, notes, and snippets.

@brucenorton
Created April 5, 2018 17:31
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/b7b40868224fc278dfd517dd802e300d to your computer and use it in GitHub Desktop.
Save brucenorton/b7b40868224fc278dfd517dd802e300d to your computer and use it in GitHub Desktop.
upload files to server
<?php
//upload.php
// *** chmod of 'uploads' to 777 ***
if (isset($_FILES['upload_file'])) {
if(move_uploaded_file($_FILES['upload_file']['tmp_name'], "../uploads/" . $_FILES['upload_file']['name'])){
echo $_FILES['upload_file']['name']. " OK";
} else {
echo $_FILES['upload_file']['name']. " KO";
}
exit;
} else {
echo "No files uploaded ...";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment