Standrad size of uploading image

Discussion in 'PHP' started by tech_tycoon, Aug 17, 2010.

  1. #1
    What is standard size to upload an image.When user are uploading a large image to my website upload time error is occurring.I am resizing image at the time of uploading also.I want to modify my code as if large image will go to upload then image upload should not occur.
    So what is standard size of image to upload on server for any website ? So that way i will fix my code.
    Thanks in advance
     
    tech_tycoon, Aug 17, 2010 IP
  2. Narrator

    Narrator Active Member

    Messages:
    392
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    80
    #2
    You can try changing the script time limit in the php.ini, so your script doesn't timeout. There is no way to check the file size before uploading with php (because its serverside) or javascript (would cause a major security hole).

    You can limit the file size in php, but that wouldn't fix your timeout issue since it checks the file size once it's already uploaded.
     
    Narrator, Aug 17, 2010 IP
  3. yohanip

    yohanip Well-Known Member

    Messages:
    350
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #3
    yes, you need to edit the php.ini
    using :
    void set_time_limit  ( int $seconds  )
    Code (markup):
    and you also need the memory setting and also maximum uploaded byte
    * upload_max_filesize = 10M
    * post_max_size = 20M
    Code (markup):
     
    Last edited: Aug 18, 2010
    yohanip, Aug 18, 2010 IP