2
0

upload_img.php 591 B

12345678910111213141516171819202122232425
  1. <?php
  2. if ((($_FILES["file"]["type"] == "image/gif")
  3. || ($_FILES["file"]["type"] == "image/jpeg")
  4. || ($_FILES["file"]["type"] == "image/pjpeg"))
  5. && ($_FILES["file"]["size"] < 20000))
  6. {
  7. if ($_FILES["file"]["error"] > 0)
  8. {
  9. echo "Error: " . $_FILES["file"]["error"] . "<br />";
  10. }
  11. else
  12. {
  13. echo "Upload: " . $_FILES["file"]["name"] . "<br />";
  14. echo "Type: " . $_FILES["file"]["type"] . "<br />";
  15. echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
  16. echo "Stored in: " . $_FILES["file"]["tmp_name"];
  17. }
  18. }
  19. else
  20. {
  21. echo "Invalid file";
  22. }
  23. ?>