[wp-trac] [WordPress Trac] #20923: Add support for mobile uploads

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 17 02:50:28 UTC 2012


#20923: Add support for mobile uploads
------------------------------+--------------------
 Reporter:  koke              |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  3.4.1
Component:  Media             |     Version:  3.4
 Severity:  normal            |  Resolution:
 Keywords:  mobile has-patch  |
------------------------------+--------------------

Comment (by georgestephanis):

 There's a reason that we've always based this off User Agent -- not JS
 tests in the browser.  That is, quite simply, because we have yet to see a
 browser test that works.

 The typical method for spotting input type support is as follows ...


 test = document.createElement( 'input' );

 test.setAttribute( 'type', 'file' );

 if ( test.type == 'file' ) {
         document.write( 'This browser supports file inputs.' );
 } else {
         document.write( 'This browser does NOT support file inputs.' );
 }

 Now, if you run that in iOS, it will always return true and yield the
 first output, as it recognizes that file is a valid property for input
 type.  They just choose not to let you do anything with it.

 If you look at the patch that I submitted up above, it actually tests to
 get the iOS version number, and compares it against version 6 -- the first
 version that will actually let you use the file inputs.  So it won't need
 to be maintained in the future, it'll just be an ifcheck against older
 versions of iOS that don't support file uploads.  Also, if the UA changes
 in the future, then the first part of the ifcheck will fail, and it will
 display the upload option!  We only really need to focus on catching the
 existing iOS < 6, as all future versions will support it.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20923#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list