[wp-trac] [WordPress Trac] #11110: SWF Upload reports file too big even though it is smaller than the max size displayed.

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 9 22:26:35 UTC 2009


#11110: SWF Upload reports file too big even though it is smaller than the max size
displayed.
--------------------------+-------------------------------------------------
 Reporter:  brianlayman   |       Owner:                                 
     Type:  defect (bug)  |      Status:  new                            
 Priority:  normal        |   Milestone:  Unassigned                     
Component:  Media         |     Version:                                 
 Severity:  normal        |    Keywords:  upload, media, error, swfupload
--------------------------+-------------------------------------------------
 The issue is that swfupload.js can trigger a file_exceeds_size_limit error
 due to two different causes (that I know of) and WordPress assumes the
 cause is one of them.

 In wp_include/script-loader.php, we define the response to
 file_exceeds_size_limit as:

 'file_exceeds_size_limit' => sprintf(__('This file is too big. Your
 php.ini upload_max_filesize is %s.'), @ini_get('upload_max_filesize')),

 However, either max_post_size or upload_max_filesize can cause an
 file_exceeds_size_limit.

 So, if my max_post_size is the still the default 8M, and my host increased
 upload_max_filesize to say 16M (from the default of 2M), uploading a 12M
 file would generate a "This file is too big. Your php.ini
 upload_max_filesize is 16M" and result in a very confused client.

 A solution to this can be found at
 http://www.php.net/manual/en/ini.core.php#79564 I'm not sure if that's the
 final code we want, but the idea is the right one... Basically find the
 min of those two values (converting from M or K or w/e for compatibility)
 and display THAT in the error message.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11110>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list