Jackal Posted March 29, 2006 Report Share Posted March 29, 2006 Kā es varu uztaisīt upload savā lapā varbūt varat parādīt kādu skripta piemēru? Link to comment Share on other sites More sharing options...
Vebers Posted March 29, 2006 Report Share Posted March 29, 2006 http://lv2.php.net/manual/en/features.file-upload.php Link to comment Share on other sites More sharing options...
Jackal Posted March 29, 2006 Author Report Share Posted March 29, 2006 Nu es apmēram sapratu kā tas notiek tikai nesaprotu vienu, kur es to uploadoto failu varu glabāt un kā saglabāt jo db man liekas, ka to nevar izdarīt, kaut gan neesmu mēģinājis Link to comment Share on other sites More sharing options...
SkyD Posted March 29, 2006 Report Share Posted March 29, 2006 Nu DB var glabāt faila nosaukumu, bet pašu failu iekš kādā mapē. Link to comment Share on other sites More sharing options...
Paulinjsh Posted March 29, 2006 Report Share Posted March 29, 2006 Var arī db glabāt. Blob laukā piem! Link to comment Share on other sites More sharing options...
Jackal Posted March 30, 2006 Author Report Share Posted March 30, 2006 Nu man ir shitāds upload skripts: <form action="" method="post" enctype="multipart/form-data"> <p>Pictures: <input type="file" name="pictures[]" /> <input type="submit" value="Send" /> </p> </form> <?php //places files into same dir as form resides foreach ($_FILES["pictures"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES["pictures"]["tmp_name"][$key]; $name = $_FILES["pictures"]["name"][$key]; move_uploaded_file($tmp_name, "C:\Web Page\EasyPHP1-8\www\upload/$name"); echo "File"; echo " "; echo $name; echo " "; echo "have been uploaded successfully"; } } ?> Kad ieeju lapā viņš uzreiz parāda Warning: Invalid argument supplied for foreach() in c:\web page\easyphp1-8\www\index.php on line 65 tomēr viss it kā strādā vienīgi nevar uploadot lielus failus. Kā uztaisīt, lai var uploadot lielākus failus, jo tagad viņš man atļauj uploadot lielākais 5MB un ja gribu uploadot lielāku failu parāda iepriekšminēto warning? Un kā lai tiek no tā warning vaļā? Link to comment Share on other sites More sharing options...
Stopp Posted March 30, 2006 Report Share Posted March 30, 2006 $_FILES['dajebkas']['error'] izmet vienu ciparu no 0 līdz 7 ja nemaldos. masīvs tas nav. max upload size var regulēt php.ini Link to comment Share on other sites More sharing options...
Kristabs Posted March 30, 2006 Report Share Posted March 30, 2006 truukst if($_SERVER['REQUEST_METHOD'] =='POST'){ //tagad daram foreach... } ieejot lapaa Tu padod tukshu mainiigo foreach`am, peec tam, kad dati tiek noposteeti, tad tik $_FILES["pictures"] tiek iesetots. Link to comment Share on other sites More sharing options...
Mister Smith Posted April 25, 2006 Report Share Posted April 25, 2006 Es vispār pārbaudē izdarīju šitā, un viss rullē. if ($_FILES){ //tagad daram foreach... } Link to comment Share on other sites More sharing options...
Recommended Posts