RE: [PHP] weird upload problem
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -Original Message- From: Sebastian [mailto:[EMAIL PROTECTED] Sent: 12 January 2005 01:59 form action=/ enctype=multipart/form-data method=post 1: input type=file name=image[]br / 2: input type=file name=image[]br / 3: input type=file name=image[]br / 4: input type=file name=image[]br / 5: input type=file name=image[]br / 6: input type=file name=image[]br / input name=submit type=submit value=submit /form if (isset($_FILES['image'])) { $number = 0; for ($i = 0; $i count($_FILES['image']); $i++) foreach ($FILES['image'] as $i=$imagefile) Solves both problems. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird upload problem
well i found the problem to #1. i forgot an = on the for() loop.. so it uploads all 6 instead of 5. still looking for a solution on #2 - Original Message - From: Sebastian [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, January 11, 2005 8:59 PM Subject: [PHP] weird upload problem Hi, im working on this mulitiple upload script to auto resize images. everything works, except two problems. 1) for some odd reason if i attach all fields with an image it only submits 5. seems its skipping one. 2) if i attach an image to field 1, 3, 5 and skip the other fields only 1 file gets uploaded.. how do i make it so it doesnt matter which fields are used? just submit whatever fields(s) are used.. i snipped a lot of the code off the script so its easier to find the problem.. maybe i just overlooked something. form action=/ enctype=multipart/form-data method=post 1: input type=file name=image[]br / 2: input type=file name=image[]br / 3: input type=file name=image[]br / 4: input type=file name=image[]br / 5: input type=file name=image[]br / 6: input type=file name=image[]br / input name=submit type=submit value=submit /form if (isset($_FILES['image'])) { $number = 0; for ($i = 0; $i count($_FILES['image']); $i++) { $number++; $imageid = time(); resize_img('image', $imageid.$number, $original_width, $original_height)); resize_img('image', 't'.$imageid.$number, $new_width, $new_height)); } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird upload problem
On Wednesday 12 January 2005 09:59, Sebastian wrote: 2) if i attach an image to field 1, 3, 5 and skip the other fields only 1 file gets uploaded.. How did you ascertain this? What does print_r($_FILES) show? Unless you're using a broken browser it *should* work. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird upload problem
Jason Wong wrote: How did you ascertain this? What does print_r($_FILES) show? Unless you're using a broken browser it *should* work. i tried both IE6 and Firebox 1.0, both do the same. does appear its being passed.. doesn't it? array: Array ( [image] = Array ( [name] = Array ( [0] = image1.jpg [1] = [2] = image2.jpg [3] = [4] = [5] = image3.jpg ) [type] = Array ( [0] = image/pjpeg [1] = [2] = image/pjpeg [3] = [4] = [5] = image/pjpeg ) [tmp_name] = Array ( [0] = /tmp/php6ubg5D [1] = [2] = /tmp/phpYjSRr2 [3] = [4] = [5] = /tmp/phpuqTWXO ) [error] = Array ( [0] = 0 [1] = 4 [2] = 0 [3] = 4 [4] = 4 [5] = 0 ) [size] = Array ( [0] = 83330 [1] = 0 [2] = 83330 [3] = 0 [4] = 0 [5] = 83330 ) ) ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird upload problem
So, in $_FILES all right. may be use foreach instead for? case count() show count of fulled cell of array, and in your case it show 3. but 3 is not end of your array. 12 2005 07:16 Sebastian (a): Jason Wong wrote: How did you ascertain this? What does print_r($_FILES) show? Unless you're using a broken browser it *should* work. i tried both IE6 and Firebox 1.0, both do the same. does appear its being passed.. doesn't it? array: Array ( [image] = Array ( [name] = Array ( [0] = image1.jpg [1] = [2] = image2.jpg [3] = [4] = [5] = image3.jpg ) [type] = Array ( [0] = image/pjpeg [1] = [2] = image/pjpeg [3] = [4] = [5] = image/pjpeg ) [tmp_name] = Array ( [0] = /tmp/php6ubg5D [1] = [2] = /tmp/phpYjSRr2 [3] = [4] = [5] = /tmp/phpuqTWXO ) [error] = Array ( [0] = 0 [1] = 4 [2] = 0 [3] = 4 [4] = 4 [5] = 0 ) [size] = Array ( [0] = 83330 [1] = 0 [2] = 83330 [3] = 0 [4] = 0 [5] = 83330 ) ) ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] weird upload problem
On Wednesday 12 January 2005 12:16, Sebastian wrote: i tried both IE6 and Firebox 1.0, both do the same. does appear its being passed.. doesn't it? array: Array ( [image] = Array ( [name] = Array ( [0] = image1.jpg [1] = [2] = image2.jpg [3] = [4] = [5] = image3.jpg ) Certainly looks like they're uploaded OK. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php