From:             [EMAIL PROTECTED]
Operating system: Linux 7.0
PHP version:      4.0.4pl1
PHP Bug Type:     HTTP related
Bug description:  HTTP_POST_FILES iteration

i have multiple upload (3) form and
when i try something like this :

reset($HTTP_POST_FILES);
for ( $i=0; $i<=2; $i++ ) {
 $temporary = "image".$i;
 $file_name = $HTTP_POST_FILES["$temporary"]['name'];
 $file_type = $HTTP_POST_FILES["$temporary"]['type'];
 $file_size = $HTTP_POST_FILES["$temporary"]['size'];
 $temp_name = $HTTP_POST_FILES["$temporary"]['tmp_name'];
 copy($temp_name, "/var/cult.bg/html/register/images/$dir_name/$file_name");
 $url = $rel_image_url . "/$file_name";
 $query_i = "INSERT INTO images VALUES 
('$id','$r_id','$file_name','$file_size','$file_type','$url')";
 mysql_query($query_i);
}

it puts only the first file in the database and gives an error - Duplicate (something).
it works only without the for cycle - with three times handling the uploads.
i'm not sure it's bug (maybe misunderstanding :).
p.s. when i do - INSERT IGNORE INTO ... it puts the first file but doesn't shows the 
error.


-- 
Edit Bug report at: http://bugs.php.net/?id=10728&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to