[ 
https://issues.apache.org/jira/browse/CB-12664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16054079#comment-16054079
 ] 

Hugo van Haaren commented on CB-12664:
--------------------------------------

basic test code of the attached example:
html:
{code:java}
<form id="fileupload-form">
        <input id="fileupload-input" type="file">  <!-- //ERROR CB-12664 input 
has no multiple attribute, in IOS 10.3.1 and higher the popup will still allow 
multple selection -->
</form>
{code}

javascript:
{code:java}
       var me = this,
            inputFile = document.getElementById('fileupload-input'),
            form  = document.getElementById('fileupload-form');

        var fileSelected = function() {
            if (inputFile.files.length > 0) {
                newFile = inputFile.files[0];

                console.log('size: ' + newFile.size); //CB-12664 ERROR will 
show size:  0 when video is selected, for images it works fine

                window.requestFileSystem(
                    LocalFileSystem.PERSISTENT,
                    0,
                    function(fileSystem) {

                        fileSystem.root.getDirectory(
                            'test',
                            {create: true},
                            function(directoryEntry) {
                                directoryEntry.getFile( new Date().getTime() + 
'-' + newFile.name, { create: true }, function (fileEntry) {
                                    fileEntry.createWriter(function 
(fileWriter) {
                                        fileWriter.onwriteend = function (e) {
                                            // for real-world usage, you might 
consider passing a success callback
                                            if (!e.target.error) {
                                                alert('Write of file "' + 
fileEntry.fullPath + '"" completed.');
                                            }
                                        };

                                        fileWriter.onerror = function (e) {
                                            // you could hook this up with our 
global error handler, or pass in an error callback
                                            alert('Write failed: ' + 
e.toString()); //CB-12664 ERROR accessing video blob to write it to device, for 
images it works fine
                                        };

                                        fileWriter.write(newFile);
                                    })
                                })
                            });
                    });           

            }
        };
        form.addEventListener('change', fileSelected);
{code}

> iOS 10.3.1 break input file videos with forced multiple select
> --------------------------------------------------------------
>
>                 Key: CB-12664
>                 URL: https://issues.apache.org/jira/browse/CB-12664
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-ios
>         Environment: phonegap build, iOS 10.3.1, iPhone 6S
>            Reporter: meir
>              Labels: critical, ios
>         Attachments: CB12664.zip
>
>
> Inputs cannot access video files because multiple file select is forced and 
> videos are no longer being compressed before being selected. 
> To test:
> - put a file input in any cordova demo application, 
> - select a video file (you will see multiple file select is forced)
> - try access the file to check the size or get the content: size is 0, no 
> content.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to