fork download
  1. <?php
  2. if (isset($_FILES['myfile'])) {
  3. $file = $_FILES['myfile'];
  4.  
  5. if ($file['error'] === 0) {
  6. $uploadPath = "uploads/" . basename($file['name']);
  7. if (move_uploaded_file($file['tmp_name'], $uploadPath)) {
  8. echo "File uploaded successfully: " . $file['name'];
  9. } else {
  10. echo "Upload failed.";
  11. }
  12. } else {
  13. echo "Error uploading file.";
  14. }
  15. }
  16. ?>
  17.  
Success #stdin #stdout 0.03s 25472KB
stdin
Standard input is empty
stdout
Standard output is empty