image size problem

Discussion in 'PHP' started by dizyn, Nov 22, 2007.

  1. #1
    Hi

    I am trying
    $_FILES['imgfile1']['size']
    PHP:
    to find image size but if the image size is more than 1.7MB it don't gives me output or sometimes it says "0"

    any solution?

    thank you
    dizyn
     
    dizyn, Nov 22, 2007 IP
  2. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #2
    hmm, i'm not sure but i havent heard about this limitation before, can you try and print out the value of $_FILES array just to be sure that it's only the size that you are missing

    ex: print_r($_FILES)
     
    serialCoder, Nov 22, 2007 IP
  3. chandubhai

    chandubhai Banned

    Messages:
    556
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Is the problem solved?
     
    chandubhai, Nov 22, 2007 IP
  4. sickanimations

    sickanimations Peon

    Messages:
    137
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It might be your web host limiting file upload sizes or connection timeouts... Who's the host?
     
    sickanimations, Nov 22, 2007 IP
  5. dizyn

    dizyn Active Member

    Messages:
    251
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    
    $_FILES
    
    PHP:
    shows 0
     
    dizyn, Nov 22, 2007 IP
  6. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #6
    Do not echo, rather print_r($_FILES).

    Two things you need to know:

    * Does your HTML form has enctype setup correctly?
    * If file uploaded is more than the allowed limit in php.ini, it will also return 0.

    Peace,
     
    Barti1987, Nov 22, 2007 IP
  7. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #7
    also put an enctype="multipart/form-data" on your form tag

    <form method="POST" name="form" enctype="multipart/form-data" >
     
    serialCoder, Nov 22, 2007 IP