upload-arduino.php 433 B

123456789101112131415
  1. <?php
  2. // mkdir and chmod arduino folder to 777
  3. //
  4. //var_dump($_FILES);
  5. $image = basename($_FILES["file"]["name"]);
  6. $target_file = "arduino/".$image;
  7. $hostname = $_SERVER['SERVER_NAME'];
  8. if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) {
  9. echo "The file $image has been uploaded to OTA server $hostname. \n";
  10. } else {
  11. echo "Sorry, there was an error uploading your file $image to OTA server $hostname. \n";
  12. }
  13. ?>