Jamesons Posted September 7, 2008 Report Share Posted September 7, 2008 (edited) Lūk man ir šāda te augšupielādēšanas sitēma: HTML (inputs): <body bgcolor="#34AB47" <form action="upload.php" method="post" enctype="multipart/form-data"> <br><p><strong>Augšupielādēt bildes:</strong><br> <br><input type="file" name="pictures[]" /></br> <br><input type="file" name="pictures[]" /></br> <br><input type="file" name="pictures[]" /></br> <br><input type="file" name="pictures[]" /></br> <br><input type="file" name="pictures[]" /></br> <br><input type="file" name="pictures[]" /></br> <br><input type="submit" value="Augšupielādēt" /></br> </p> </form> </body> Tālāk ir upload.php fails, caur kuru tiek lādētas bildes iekšā: <?php // In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead // of $_FILES. $uploaddir = '/var/www/atteli/rozu_laukums/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); echo '<pre>'; if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; ?> Nospiežot pogu Augšupielādēt izlec sekojošs errors: Possible file upload attack! Here is some more debugging info:Array ( [pictures] => Array ( [name] => Array ( [0] => bg.jpg ) [type] => Array ( [0] => image/jpeg ) [tmp_name] => Array ( [0] => C:\WINDOWS\Temp\php6DFB.tmp ) [error] => Array ( [0] => 0 ) [size] => Array ( [0] => 133721 ) ) ) Atvainojos, ka posts varbūt ir par garu, bet kāds zin, kas par problēmu varētu būt? paldies jau iepriekš. Edited September 7, 2008 by Jamesons Link to comment Share on other sites More sharing options...
andrisp Posted September 7, 2008 Report Share Posted September 7, 2008 Formā tu izmanto HTML masīvu, lai augšupielādētu vairākus failus, bet iekš PHP koda tu dari tā it kā būtu tikai viens fails. Skaties manuāli. Tur ir parādīts kā vairākus failus reizē augšupielādēt. http://lv2.php.net/features.file-upload Link to comment Share on other sites More sharing options...
Jamesons Posted September 7, 2008 Author Report Share Posted September 7, 2008 Tu domā, nomainot 'userfile' uz 'pictures', es īsti nevaru atrast to vietu Link to comment Share on other sites More sharing options...
andrisp Posted September 7, 2008 Report Share Posted September 7, 2008 Ā, nu jā - tu pat lauko nosaukumu neīsto izmanto. Link to comment Share on other sites More sharing options...
Jamesons Posted September 7, 2008 Author Report Share Posted September 7, 2008 Ok, laukumus nosaukumus es izlaboju, bet, kur tad vēl ir kkas nepareizi, es personīgi ar savu iesācēja aci nevaru saskatīti. Link to comment Share on other sites More sharing options...
Pentiums Posted September 7, 2008 Report Share Posted September 7, 2008 google joprojām strādā http://www.google.lv/search?q=multiple+fil...mp;client=dirsa Link to comment Share on other sites More sharing options...
superKrona Posted September 8, 2008 Report Share Posted September 8, 2008 A kas no šitā labāks &client=dirsa? Link to comment Share on other sites More sharing options...
Jamesons Posted September 8, 2008 Author Report Share Posted September 8, 2008 Paldies Pentium, atradu visu ko vajag un viss iet! :) Link to comment Share on other sites More sharing options...
Recommended Posts