Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <?php
  2.  
  3. $uploadLocation = "c:\inetpub\wwwroot\style\\";
  4.  
  5.  
  6. ?>
  7.  
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
  9. <html>
  10. <head>
  11. <title>Upload file </title>
  12. <link href="style/style.css" rel="stylesheet" type="text/css" />
  13. </head>
  14. <body>
  15. <div id="main">
  16. <div id="caption">UPLOAD FILE</div>
  17. <div id="icon">&nbsp;</div>
  18. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="fileForm" id="fileForm" enctype="multipart/form-data">
  19. File da caricare:<center>
  20. <table>
  21. <tr><td><input name="upfile" type="file" size="36"></td></tr>
  22. <tr><td align="center"><br/><input class="text" type="submit" name="submitBtn" value="Upload"></td></tr>
  23. </table></center>
  24. </form>
  25. <?php
  26. if (isset($_POST['submitBtn'])){
  27.  
  28. ?>
  29. <div id="caption">ESITO</div>
  30. <div id="icon2">&nbsp;</div>
  31. <div id="result">
  32. <table width="100%">
  33. <?php
  34.  
  35. $target_path = $uploadLocation . basename( $_FILES['upfile']['name']);
  36.  
  37. if(move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {
  38. echo "Il file: ". basename( $_FILES['upfile']['name']).
  39. " &egrave; caricato. <a href=\"http://waritalia.eu/".$_FILES['upfile']['name']."\">Clicca qui</a> per vedere il tuo file.";
  40. } else{
  41. echo "Non ho caricato il tuo file!";
  42. }
  43.  
  44. ?>
  45. </table>
  46. </div>
  47. <?php
  48. }
  49. ?>
  50. <div>
  51. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement