Skip to content

Instantly share code, notes, and snippets.

@mnsmarcelo
Created May 28, 2015 23:43
Show Gist options
  • Save mnsmarcelo/b7fd98a51083e7e25d43 to your computer and use it in GitHub Desktop.
Save mnsmarcelo/b7fd98a51083e7e25d43 to your computer and use it in GitHub Desktop.
<?php
$uploaddir = 'files/';
$uploadfile = $uploaddir . basename($_FILES['arquivo']['name']);
echo $uploadfile;
echo '<pre>';
if (move_uploaded_file($_FILES['arquivo']['tmp_name'], $uploadfile)) {
echo "Arquivo válido e enviado com sucesso.\n";
} else {
echo "Possível ataque de upload de arquivo!\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment