Skip to content

Instantly share code, notes, and snippets.

@InsiderJanggo
Created July 7, 2020 00:50
Show Gist options
  • Save InsiderJanggo/8e58e707a2c0776e5cf9cfec13b72f00 to your computer and use it in GitHub Desktop.
Save InsiderJanggo/8e58e707a2c0776e5cf9cfec13b72f00 to your computer and use it in GitHub Desktop.
A Simple Upload script
<?php
// retrieve data file
$filename = $_FILES['berkas']['name'];
$tempname = $_FILES['berkas']['tmp_name'];
//specify the location of the file to be moved
$dirUpload = "terupload/";
// move the file
$uploaded = move_uploaded_file($tempname, $dirUpload.$filename);
if ($uploaded) {
echo "Succesfully Uploaded!<br/>";
echo "Link: <a href='".$dirUpload.$filename."'>".$filename."</a>";
} else {
echo "Upload Failed!";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment