Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Restricting uploads to zip

    Hi. I'm writing a file upload script and I want to restrict users to be able to only upload zip files.



    What is the condition I would need to add to this IF statement? I've looked around the web but I can only find solutions for uploading images.

    Code:
    if ($_FILES["file"]["size"] < 3145728) && ____________________ {
    my code
    }

  • #2
    New Coder
    Join Date
    Nov 2006
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wait this is a PHP question... I have no idea why I asked it here.

  • #3
    New Coder
    Join Date
    Aug 2006
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ummmmm....

    Code:
    ($_FILES["file"]["type"] == "application/zip")


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •