Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Upload kilku plikow i ich rozmiar
coolik
post
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 20.06.2004

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


  1. <div align=center>
  2.  
  3. <table border=0 cellpadding=0 cellspacing=0 style='border-collapse: collapse' bordercolor=#111111 width=543 height=8>
  4. <tr>
  5. <td width=25 height=19><b><font face=Verdana size=1>ID</font></b></td>
  6. <td width=5 height=1></td>
  7. <td width=348 height=1><b><font face=Verdana size=1>Ścieżka pliku</font></b></td>
  8. <td width=5 height=1></td>
  9. <td width=80 height=1><b><font face=Verdana size=1>Rozmiar</font></b></td>
  10. </tr>
  11.  
  12. <?php 
  13.  
  14. if ( isSet( $_FILES['pliczek'] ) === true ) 
  15. { 
  16. $files = is_array( $_FILES['pliczek'] ) === true ? $_FILES['pliczek'] : array( $_FILES['pliczek'] ); 
  17. $debug = ''; 
  18. $allow = array ('image/x-png', 'image/gif', 'image/pjpeg'); 
  19.  
  20. for ( $i = 0, $j = sizeOf( $files['name'] ); $i < $j; $i++ ) 
  21. { 
  22. if ( empty( $files['name'][ $i ] ) === true ) 
  23. { 
  24. continue; 
  25. } 
  26.  
  27. if ( in_array( $files['type'][ $i ], $allow ) === true ) 
  28. { 
  29. if ( move_uploaded_file( $files['tmp_name'][ $i ], '/home/moderniz/public_html/images/artykuly/' . $_SESSION['katalog1'] . '/' . $files['name'][ $i ] ) === true ) 
  30. { 
  31.  
  32. $plik=$files['name'][ $i ];
  33. $size = filesize($plik);
  34.  
  35. $kilob=$size/1024;
  36. $skb = substr($kilob, 0, 5);
  37.  
  38. $rest = substr($files['name'][ $i ], 0, 23); 
  39.  
  40. $debug .= &#092;"<tr>
  41. <td width=26 height=19 background=http://www.modernizacje.net/admin/upload/gfx/tlo.jpg align=center>
  42. <p align=left><font size=1 face=Verdana>1</font></td>
  43. <td width=5 height=1></td>
  44. <td width=348 height=1 background=http://www.modernizacje.net/admin/upload/gfx/tlo.jpg><font size=1 face=Verdana><a target='_blank' style='text-decoration: none' href='http://www.modernizacje.net/images/artykuly/\" . $_SESSION['katalog1'] . \"/\" . $files['name'][ $i ] . \"'>
  45.  
  46. http://www.modernizacje.net/admin/upload/pliki/$rest</a>
  47.  
  48.  
  49.  
  50. </font></td>
  51. <td width=5 height=1></td>
  52. <td width=80 height=1 background=http://www.modernizacje.net/admin/upload/gfx/tlo.jpg>
  53. <p align=left><font face=Verdana size=1>&#092;" . $skb . \"
  54.  
  55.  
  56.  &nbsp;kb</font></td>
  57. </tr>
  58.  
  59.  
  60.  
  61. &#092;";
  62.  
  63. } 
  64. else 
  65. { 
  66. $debug .= $files['name'][ $i ]; 
  67. } 
  68. } 
  69. else 
  70. { 
  71. $debug .= $files['name'][ $i ] . ' invalid type'; 
  72. } 
  73. } 
  74.  
  75. print $debug; 
  76. } 
  77.  
  78.  echo $_SESSION['katalog1'] . ' - ' . $_SESSION['tytul1'] . ' - ' . $_SESSION['kat1'] . ' - ' . $_SESSION['dostawca1'] . ' - ' . $_SESSION['ld1'];
  79. ?>
  80.  
  81.  
  82.  <tr>
  83. <td width=\"26\" height=\"19\" background=\"http://www.modernizacje.net/admin/upload/gfx/tlo.jpg\" align=\"center\">
  84. &nbsp;</td>
  85. <td width=\"5\" height=\"1\"></td>
  86. <td width=\"348\" height=\"1\" background=\"http://www.modernizacje.net/admin/upload/gfx/tlo.jpg\">&nbsp;</td>
  87. <td width=\"5\" height=\"1\"></td>
  88. <td width=\"80\" height=\"1\" background=\"http://www.modernizacje.net/admin/upload/gfx/tlo.jpg\"></td>
  89. </tr>
  90. </table>
  91. </div>


mam taki skrypt ale funkcja filesize nie zlicza mi rozmiary olijku :| wiecie co tu jest nie tak?
Go to the top of the page
+Quote Post

Posty w temacie


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: 23.08.2025 - 11:04