Skip to content

Instantly share code, notes, and snippets.

@kevinholler
Created July 16, 2012 16:44
Show Gist options
  • Save kevinholler/3123707 to your computer and use it in GitHub Desktop.
Save kevinholler/3123707 to your computer and use it in GitHub Desktop.
<?php
$target = sys_get_temp_dir();
$target = $target . "../" . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
?>
<form enctype="multipart/form-data" action="index.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment