saeedm Posted March 6, 2007 Share Posted March 6, 2007 I test this code in PHP4, It work well, but in freeBSD and PHP5 I get error # 6 ($_FILES['pictures']['error']) the main code is: [codes] <form action="new.php" method="post" enctype="multipart/form-data"> <p>Pictures: <input type="file" name="pictures[]" /> <input type="file" name="pictures[]" /> <input type="file" name="pictures[]" /> <input type="submit" value="Send" /> </p> </form> <?php 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, "data/$name"); } } ?> [/codes] What's wrong with this code or PHP5? Link to comment https://forums.phpfreaks.com/topic/41473-file-upload-in-php5/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.