image size problem

Discussion in 'PHP' started by dizyn, Jan 3, 2009.

  1. #1
    On upload I wanted to find size of the image but when i tried to upload an image of size more than 2MB its give me 0.

    Here is code:
    echo $_FILES['imgfile1']['size'];
    PHP:
     
    dizyn, Jan 3, 2009 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    The 2MB is a hard limit set by php. Some hosts set it lower.

    If you have your own server I think you can adjust the number.
     
    Colbyt, Jan 3, 2009 IP
  3. dizyn

    dizyn Active Member

    Messages:
    251
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Even tried
     
    dizyn, Jan 3, 2009 IP
  4. dizyn

    dizyn Active Member

    Messages:
    251
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    dizyn, Jan 3, 2009 IP
  5. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #5
    ask your host to increase the upload limit

    Try it

    Regards

    Alex
     
    kmap, Jan 3, 2009 IP
  6. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #6
    On a shared server I seriously doubt that you can adjust all the setttings necessary because There may be more than just the filesize involved. I also don't think the host will because it may affect other users.

    I learned this trying to increase the limit for phpmyadmin on my local machine. Not sure if the following appleis to images or not but I also had to increase Max_post size and max_memory. I may not have listed those in proper syntax.

    At one time I had an image resize program running on a shared server and about the maximum that could be uploaded was a 1200KB file.

    There are a few fine, free, resizers that you can run on your local computer and suggest to people that they download to work arond this problem.
     
    Colbyt, Jan 3, 2009 IP