uploading multiple image files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stijn Goris

    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


  • Shawn Wilson

    #2
    Re: uploading multiple image files

    Stijn Goris wrote:[color=blue]
    >
    > 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?[/color]

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



    (I haven't tried it)

    Shawn
    --
    Shawn Wilson
    shawn@glassgian t.com

    Comment

    Working...