Jump to content
php.lv forumi

PHP file upload


Recommended Posts

taatad. PHP versija 5.2.0

Ir vienkārša forma

<form action="" method="post" enctype="multipart/form-data" name="form1">
 <table width="900" border="0" cellspacing="2" cellpadding="0">
<tr>
  <td width="106" valign="top">Īss apraksts</td>
  <td width="794"><input name="apr" type="text" id="apr" size="70"></td>
</tr>
<tr>
  <td valign="top">Pilns apraksts</td>
  <td><textarea name="apr_full" cols="70" rows="5" id="apr_full"></textarea></td>
</tr>
<tr>
  <td valign="top">Bilde  1</td>
  <td><input type="file" name="fails"></td>
</tr>

<tr>
  <td valign="top"> </td>
  <td> </td>
</tr>
<tr>
  <td colspan="2" align="center" valign="top"><input name="add_lampa" type="submit" id="add_lampa" value="Pievienot"></td>
</tr>
 </table>
</form>

 

tad ir šāds kods:

<?php
echo '<pre>';
print_r($_FILES);
echo '</pre>';
?>

kad nospiež submit ar tukšām formas vērtībām viss ir ok.

Array

(

[fails] => Array

(

[name] =>

[type] =>

[tmp_name] =>

[error] => 4

=> 0

)

 

)

ja pievieno 90 baitu mazu failu , arī ir ok:

Array

(

[fails] => Array

(

[name] => csb.log

[type] => text/plain

[tmp_name] => C:\WINDOWS\Temp\php1013.tmp (šāds fails neparādas)

[error] => 0

=> 90

)

 

)

 

ja fails jau ir 580KB liels, tā firefox bļauj ka skripts neatbild: ff_err.JPG

Array

(

[fails] => Array

(

[name] => ctp.bak

[type] => application/octet-stream

[tmp_name] => C:\WINDOWS\Temp\php1015.tmp

[error] => 0

=> 594944

)

 

)

 

 

tas viss notiek uz windows XP, apache log failā nekādu kļūdu paziņojumu nav, PHP arī kļūdu nerāda. [tmp_name] => C:\WINDOWS\Temp\php1015.tmp tajā mapē nekāds jauns fails neparādas. temp mapē visiem ir visas tiesības.

php info šeit: http://mdsl.ath.cx/info.php

php versiju neesmu meeginaajis upgreidot ...

Link to comment
Share on other sites

ja fails jau ir 580KB liels, tā firefox bļauj ka skripts neatbild:

Array

(

[fails] => Array

(

[name] => ctp.bak

[type] => application/octet-stream

[tmp_name] => C:\WINDOWS\Temp\php1015.tmp

[error] => 0

=> 594944

)

 

)

apache log failā nekādu kļūdu paziņojumu nav, PHP arī kļūdu nerāda.

Un kur problema???

--> fails tachu ir atnacis ... Bljauj jau tikai FF.... (kautkads plugins)

+ neslikti butu arii pasaa formaa noraadiit max atljauto faila lielumu ....

+ paskaties cik ir MAX atljautais faila izmers... iepejams ka 512 KB ...

Edited by Grey_Wolf
Link to comment
Share on other sites

×
×
  • Create New...