This isn't a problem with your script. This is a problem with the configuration of PHP. If you have access to the php.ini file(or equivalent), you need to change PHP's post_max_size and upload_max_filesize and possibly max_input_time. This is possible in PHP code by adding these lines
Hope that helps.PHP Code:ini_set('post_max_size','500M');//Upload up to 500 Megabytes
ini_set('upload_max_file_size','500M');//Upload up to 500 Megabytes

