470,849 Members | 1,166 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

uploading multiple image files

hi all,

A user can upload maximum 10 image files at once.
When the user only uploads 6 images, 4 fileboxes are left blank. I use
function checkImage() //check the the extension. Must be a jpeg
{
$bool = 0;

$this->type = $_FILES['imagefile']['type'][$this->index];
if ($this->type == "image/pjpeg" || $this->type == "image/jpg")
{
$bool = 1;
}
else
{
$bool = 0;
$this->errorMessage .= "- Not an image ($this->type). Image has to be a
jpeg<br>";
}
return $bool;
}

to test the image.
I go from 0 -> 10. When it comes along a blank imagebox the function doesn't
return anything. Someone knwos why. Is there a better way to check for a
blank filebox that is send?

kind regards
Stijn
Jul 17 '05 #1
1 1823
Stijn Goris wrote:

hi all,

A user can upload maximum 10 image files at once.
When the user only uploads 6 images, 4 fileboxes are left blank. I use
function checkImage() //check the the extension. Must be a jpeg
{
$bool = 0;

$this->type = $_FILES['imagefile']['type'][$this->index];
if ($this->type == "image/pjpeg" || $this->type == "image/jpg")
{
$bool = 1;
}
else
{
$bool = 0;
$this->errorMessage .= "- Not an image ($this->type). Image has to be a
jpeg<br>";
}
return $bool;
}

to test the image.
I go from 0 -> 10. When it comes along a blank imagebox the function doesn't
return anything. Someone knwos why. Is there a better way to check for a
blank filebox that is send?


Check the comment from "zilinex at linuxmail dot org" at:

http://ca3.php.net/features.file-upload

(I haven't tried it)

Shawn
--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by ok | last post: by
7 posts views Thread by lion | last post: by
6 posts views Thread by B | last post: by
5 posts views Thread by Chris | last post: by
1 post views Thread by wenqiang7 | last post: by
pezholio
1 post views Thread by pezholio | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.