Jump to content
php.lv forumi

Upload


Jackal

Recommended Posts

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

  • 4 weeks later...
×
×
  • Create New...