Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2004, 11:00 PM
Registered User
 
Join Date: Jun 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default multiple file upload errors

Hiya

I have a multiple file upload form, input defined by:

for($i = 0; $i<5; $i++)
  { echo"<......<td><input type=file name='userfile[".($i+1)."]'></td>.....";
}

and the receiving code needs to accept that maybe only one file has been chosen. anyways, i tried this:

$uploaddir = "CustomerPics2/" . $customer_id . "/" .$orderid ."/";
$uploadfile = $uploaddir . $_FILES['userfile']['name'];




while($_FILES['userfile'][$i]&&$_FILES['userfile'][$i]!='none'){
    move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $uploadfile);
}

as I thought the while statement would take care of the blank fields.

nonetheless, its not working.

all help gratefully welcomed :)

Cheers,
Laurie





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET Component for multiple file upload subhasps8 ASP.NET 1.0 and 1.1 Professional 1 June 22nd, 2007 06:43 AM
Multiple file upload problem suchita_sindhu .NET Framework 1.x 0 September 8th, 2006 03:06 AM
Rename multiple file upload in sequential order flyguylol PHP How-To 0 January 11th, 2006 06:05 PM
Whole Folder upload(Multi file Upload) ramasamy_rams XML 1 September 9th, 2005 12:43 PM
Script to upload text file to SQL with errors ss2003 Beginning PHP 2 March 10th, 2004 12:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.