Created
July 7, 2020 00:50
-
-
Save InsiderJanggo/8e58e707a2c0776e5cf9cfec13b72f00 to your computer and use it in GitHub Desktop.
A Simple Upload script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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