Upload Script - File types - Categorize them

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

    Upload Script - File types - Categorize them

    Hello there...
    I am trying to Create a script that uploads multiple files (that doesn't
    really matter)
    So I am looping trough the $_FILES[files][name]
    while(list($key ,$value) = each($_FILES['files']['name']))
    {
    echo $value.' ';
    echo $_FILES['files']['type'][$key];
    }
    While I am in the loop I want to check if the file is an image or another
    file and call the appropriate script.
    if ($_FILES['files']['type'][$key])
    upload_image();
    else
    upload_file();

    My question is how can I check if the file is an image ?
    NOTE: I have two different functions to upload files because the
    upload_image() creates thumbnales and resizes an image.

    Thanks for your Time !


  • John Dunlop

    #2
    Re: Upload Script - File types - Categorize them

    Angelos wrote:
    [color=blue]
    > My question is how can I check if the file is an image ?[/color]

    mime_content_ty pe()



    --
    Jock

    Comment

    Working...