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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Post Unable to upload TIF type image file in php

    This code work for all other images expect TIF type image of size 124KB..
    where the problem lies???
    Code:
    if ((($_FILES["file"]["type"] == "image/gif")
    || ($_FILES["file"]["type"] == "image/jpeg")
    || ($_FILES["file"]["type"] == "image/TIF")
    || ($_FILES["file"]["type"] == "image/pjpeg"))
    && ($_FILES["file"]["size"] < 20000000))
      {
      if ($_FILES["file"]["error"] > 0)
        {
        echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
        }
      else
        {
         move_uploaded_file($_FILES["file"]["tmp_name"],"Fingerprints/" . $_FILES["file"]["name"]);
        $path="Fingerprints/" . $_FILES["file"]["name"];
    		 }
        }
    else
      {
     echo "Invalid file";
      }
    Last edited by Saima Nazir; 04-13-2012 at 09:43 AM.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Could it be because your code has TIF in uppercase and the type has it in lowercase?
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    Saima Nazir (04-13-2012)

  • #3
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Changing it to lower case makes no difference...
    still I am unable to upload it....

  • #4
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts

  • Users who have thanked litebearer for this post:

    Saima Nazir (04-14-2012)

  • #5
    New to the CF scene
    Join Date
    Apr 2012
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts
    thnx...now it works...TIFF

  • #6
    Regular Coder
    Join Date
    Apr 2004
    Posts
    298
    Thanks
    0
    Thanked 23 Times in 23 Posts
    hosting...

    1. Bad manners to 'hijack' someone's thread.
    2. Start a new thread
    3. State the error/problem you are gettinghaving
    4. Show your code (be sure to use the open/close php tags around your code)


  •  

    Tags for this Thread

    Posting Permissions

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