Problems with Multi-Uploads (AGAIN)

From: Date: Sat, 01 Jun 2002 21:54:24 +0000
Subject: Problems with Multi-Uploads (AGAIN)
Groups: php.general 
Request: Send a blank email to php-general+get-100261@lists.php.net to get a copy of this message
Okay so this is what I'm trying, basically for the purposes of posting a news article I want to be able to upload supporting text files with the content of the article. Here's what I've got so far... I think I've totally missed the mark or understood the documentation in the manual on this... Someone please set me straight: <?php /*Some loops will be added to this after variables from the previous page. This is why this has been printed into PHP format.*/ print("<form action=\"process_form.php\" method=\"post\" enctype=\"multipart/form-data\">"); print("First File: <input name=\"userfile[0]\" type=\"file\"><br>"); print("Second File: <input name=\"userfile[1]\" type=\"file\"><br>"); print("<input type=\"submit\" value=\"Upload Files\">"); print("</form>"); ?> This is the catch file...: <?php if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'][0])) { copy($HTTP_POST_FILES['userfile']['tmp_name'][0], "articles/placetogo"); copy($HTTP_POST_FILES['userfile']['tmp_name'][1], "articles/placetogo"); print("Files Loaded Successfully!"); } else { print("Unable to Load Files"); } ?> Any help is appreciated. Sorry if the formatting on this came out strange. __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com

« previous php.general (#100261) next »