Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> problem z uploadem
Superhero
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 27.07.2004

Ostrzeżenie: (0%)
-----


podpowiedzcie mi co jest zle z tym skyptem, w ogole nie chce mi robic uploadu:

  1. <? 
  2.  
  3. if ($ile==1) { 
  4.  
  5. print&#092;"<html><head></head> 
  6. <body> 
  7. <form action=&#092;"upl.php?ile=2\" style=\"display:inline;\" method=\"post\" enctype=\"multipart/form-data\"> 
  8. <input type=&#092;"hidden\" name=\"form_sent\" value=\"1\"> 
  9. <br><input name=&#092;"req_file\" type=\"file\"><br> 
  10. </center><br><br> 
  11. <input type=&#092;"submit\" value=\"dodaj ť\"> 
  12. </form> 
  13. </body></html>&#092;"; 
  14.  
  15.  
  16. } elseif ($ile==2) { 
  17.  
  18.  
  19. switch ($uploaded_file['error']) 
  20. { 
  21. case 1: // UPLOAD_ERR_INI_SIZE 
  22. case 2: // UPLOAD_ERR_FORM_SIZE 
  23. print&#092;"1\"; 
  24. break; 
  25.  
  26. case 3: // UPLOAD_ERR_PARTIAL 
  27. print&#092;"2\"; 
  28. break; 
  29.  
  30. case 4: // UPLOAD_ERR_NO_FILE 
  31. print&#092;"3\"; 
  32. break; 
  33.  
  34. default: 
  35. // No error occured, but was something actually uploaded? 
  36. if ($uploaded_file['size'] == 0) 
  37. print&#092;"4\"; 
  38. } 
  39.  
  40.  
  41. if (isset($_POST['form_sent'])) 
  42. { 
  43.  
  44. $uploaded_file = $_FILES['req_file']; 
  45. if (is_uploaded_file($uploaded_file['tmp_name'])) 
  46. { 
  47.  
  48.  
  49. $allowed_types = array('image/jpeg'); 
  50.  
  51. if (!in_array($uploaded_file['type'], $allowed_types)) 
  52. print&#092;"zły format\"; 
  53.  
  54.  
  55. $temp = @move_uploaded_file($uploaded_file['tmp_name'] , '11111111111111.jpg'); 
  56. @chmod('11111111111111.jpg', 0644); 
  57. @unlink('11111111111111.gif'); 
  58. @unlink('11111111111111.png'); 
  59.  
  60. } 
  61. } 
  62. } 
  63. ?>


zwraca problem "4"...
Go to the top of the page
+Quote Post

Posty w temacie
- Superhero   problem z uploadem   29.06.2005, 18:08:21
- - gu35t   [PHP] pobierz, plaintext <?error_reporting...   29.06.2005, 18:30:05


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 21:23