uploader.php 885 B

12345678910111213141516171819202122232425
  1. <?php
  2. session_start();
  3. include('logo.html');
  4. include('menulist.html');
  5. include('static-configuration');
  6. // We just email notification for now. Auto-analysis RSN.
  7. if ($_FILES["uploadedfile"]["error"] > 0) {
  8. echo "Error: " . $_FILES["uploadedfile"]["error"] . "<br />";
  9. exit();
  10. }
  11. $dest = tempnam($tempfolder, "upload-");
  12. move_uploaded_file($_FILES["uploadedfile"]["tmp_name"], $dest);
  13. $subject = "CCAN: code upload by '" . $_POST['email'] . "' with name " . $_FILES["uploadedfile"]["name"];
  14. $message = "File type: ".$_FILES["uploadedfile"]["type"]."\n".
  15. "Size: ".$_FILES["uploadedfile"]["size"]."\n".
  16. "Claimed email: ".$_POST['email']."\n".
  17. "File destination: ".$dest."\n";
  18. mail($ccanadmin, $subject, $message, "From: $frommail");
  19. echo "<div align=\"center\"> Thanks!<br>Stored to temporary location.
  20. Mail will be send to admin to get verification of the code.<//div>";
  21. ?>