Skip to content

Instantly share code, notes, and snippets.

@mokkun
Created September 14, 2011 17:48
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 mokkun/1217231 to your computer and use it in GitHub Desktop.
Save mokkun/1217231 to your computer and use it in GitHub Desktop.
<?php
$target_path = "images/";
$target_path = $target_path . basename($_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['file']['name']) . " has been uploaded";
} else {
echo "There was an error uploading the file, please try again!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment