You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by fberton <gi...@git.apache.org> on 2014/06/20 20:20:46 UTC

[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

GitHub user fberton opened a pull request:

    https://github.com/apache/cordova-plugin-file/pull/54

    CB-6994 - Windows 8 does not save big file transferred using Blob

    When trying to save Blob using FileWriter.write method, if the blob's size is too high, we get a stack overflow exception during the conversion of the blob into an basic array.
    
    In order to avoid this exception, we pass the Blob or File directly in FileProxy (avoid the conversion to ArrayBuffer) and we use a specific method in FileProxy to save the Blob directly to the filesystem by using Streams (safe).
    
    More info at : https://issues.apache.org/jira/browse/CB-6994

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Touchit/cordova-plugin-file CB-6994

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-file/pull/54.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #54
    
----
commit 823d2ff100757b21411e990633d084482bbca52e
Author: Florian BERTON <fl...@touchify.co>
Date:   2014-06-20T17:22:16Z

    Fix function write for big files on windows 8

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-61273536
  
    It's not the same issue. 
    
    This issue was only applicable to Windows 8 which tried to serialize files into plain old arrays and create stack overflow exception.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-51863357
  
    Is this still valid? It is almost impossible to tell what has changed with all the whitespace noise in FileProxy.js.
    If this is still valid, please rebase as there are currently merge conflicts.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18519036
  
    --- Diff: src/windows/FileProxy.js ---
    @@ -518,36 +518,69 @@ module.exports = {
             if (data instanceof ArrayBuffer) {
                 data = Array.apply(null, new Uint8Array(data));
             }
    -        
    -        var writePromise = isBinary ? Windows.Storage.FileIO.writeBytesAsync : Windows.Storage.FileIO.writeTextAsync;
     
    -        
             fileName = fileName.split("/").join("\\");
     
    -
             // split path to folder and file name
             var path = fileName.substring(0, fileName.lastIndexOf('\\')),
                 file = fileName.split('\\').pop();
    -        
     
             getFolderFromPathAsync(path).done(
                 function(storageFolder) {
                     storageFolder.createFileAsync(file, Windows.Storage.CreationCollisionOption.openIfExists).done(
                         function(storageFile) {
    -                        writePromise(storageFile, data).
    -                            done(function () {
    -                                win(data.length);
    -                            }, function () {
    -                                fail(FileError.INVALID_MODIFICATION_ERR);
    -                            });
    -                    }, function() {
    +                        if (data instanceof Blob || data instanceof File) {
    +                            storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite).done(
    +                                function (output) {
    +                                    var input = data.msDetachStream();
    --- End diff --
    
    1. in case of data is File it fails since File does not have msDetachStream method
    2. I would also do (detachStream || msDetachStream) so that it will work in future versions


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18519099
  
    --- Diff: src/windows/FileProxy.js ---
    @@ -518,36 +518,69 @@ module.exports = {
             if (data instanceof ArrayBuffer) {
                 data = Array.apply(null, new Uint8Array(data));
             }
    -        
    -        var writePromise = isBinary ? Windows.Storage.FileIO.writeBytesAsync : Windows.Storage.FileIO.writeTextAsync;
     
    -        
             fileName = fileName.split("/").join("\\");
     
    -
             // split path to folder and file name
             var path = fileName.substring(0, fileName.lastIndexOf('\\')),
                 file = fileName.split('\\').pop();
    -        
     
             getFolderFromPathAsync(path).done(
                 function(storageFolder) {
                     storageFolder.createFileAsync(file, Windows.Storage.CreationCollisionOption.openIfExists).done(
                         function(storageFile) {
    -                        writePromise(storageFile, data).
    -                            done(function () {
    -                                win(data.length);
    -                            }, function () {
    -                                fail(FileError.INVALID_MODIFICATION_ERR);
    -                            });
    -                    }, function() {
    +                        if (data instanceof Blob || data instanceof File) {
    +                            storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite).done(
    +                                function (output) {
    +                                    var input = data.msDetachStream();
    --- End diff --
    
    Try the following test: file.spec.106 should be able to write a File to a FileWriter
    https://github.com/apache/cordova-plugin-file/blob/master/tests/tests.js#L2464



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18538458
  
    --- Diff: src/windows/FileProxy.js ---
    @@ -516,38 +556,50 @@ module.exports = {
                 isBinary = args[3];
     
             if (data instanceof ArrayBuffer) {
    -            data = Array.apply(null, new Uint8Array(data));
    +            var dataView = new DataView(data);
    +            data = new Blob([dataView]);
    --- End diff --
    
    In my case it fails with InvalidStateError. But the following code works. Pls double check
    if (data instanceof ArrayBuffer) {
        //var dataView = new DataView(data);
        //var data2 = new Blob([dataView]);
        data = new Blob([data]);
    }
    
    I see similar code is used in the following test
    http://jsperf.com/array-buffer-blob


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18530459
  
    --- Diff: src/windows/FileProxy.js ---
    @@ -518,36 +518,69 @@ module.exports = {
             if (data instanceof ArrayBuffer) {
    --- End diff --
    
    I did not remove this line in my update since user can pass ArrayBuffer directly to FileWriter.write.
    In this case, we need to convert ArrayBuffer. I optimized the conversion by using DataView to transform ArrayBuffer into Blob and use the best method to write big files.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58158808
  
    I'll have a look too, if it is not already merged. 
    
    Sent from my iPhone
    
    > On Oct 7, 2014, at 2:14 AM, Maxime LUCE <no...@github.com> wrote:
    > 
    > @sgrebnov Thanks
    > 
    > \
    > Reply to this email directly or view it on GitHub.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-file/pull/54


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by clelland <gi...@git.apache.org>.
Github user clelland commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-60296900
  
    Probably not the same issue, @shenzhuxi -- Android hasn't used that technique for binary data in at least a year. (Not saying that you don't have a legitimate bug; if you can reproduce it, please open another issue for it, though)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58192316
  
    Just an additional proposed improvement to improve readability (not critical): it will be great if blob/array buffer writing logic is wrapped to separate functions (writeArrayBufferAsync/writeBlobAsync), similar to
    Windows.Storage.FileIO.writeBytesAsync
    Windows.Storage.FileIO.writeTextAsync
    
    So we can continue using logic with writePromise:
    
    if (data instanceof ArrayBuffer) {
        writePromise = writeArrayBufferAsync;
    } else if (data instanceof Blob) {
        writePromise = writeBlobAsync;
    } else if ...



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58514355
  
    @sgrebnov I reviewed your changes and it's OK for me.
    Thanks for merging.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58157317
  
    @sgrebnov Thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58155241
  
    Maxime, I'll be able to review and test this later today, thx for the fix!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by shenzhuxi <gi...@git.apache.org>.
Github user shenzhuxi commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-60240611
  
    In Android, I tried to copy a 14MB file from html file input with org.apache.cordova.file 1.3.1. The App crashed and a 0 byte file was copied. I'm not sure is it the same problem. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58211689
  
    I created 2 shortcuts to __writeBytesAsync__ and __writeTextAsync__ and a new function __writeBlobAsync__.
    
    Then I do :
    
    if (data instanceof Blob) {
     writePromise = writeBlobAsync;
     } else if (isBinary) {
     writePromise = writeBytesAsync;
     } else {
     writePromise = writeTextAsync;
    }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by BBosman <gi...@git.apache.org>.
Github user BBosman commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-51883097
  
    You can see a commit diff ignoring whitespace changes by appending `?w=1` to the querystring.
    
    So for this pull request's commit that would be: https://github.com/Touchit/cordova-plugin-file/commit/823d2ff100757b21411e990633d084482bbca52e?w=1
    
    Doesn't change the fact that it needs rebasing, but allows for a clean(er) view of the intended changes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58239667
  
    Reviewed, lgtm except some inline note and failed test 'file.spec.106 should be able to write a File to a FileWriter' . This is because 'File' is cordova specific implementation so does not have msDetachStream method in comparion to native Blob.
    
    I'll merge this version tomorrow and do one more iteration improving FileProxy since I see many tests failed. Thank you, @SomaticIT  for this patch!



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-57182258
  
    Hey @sgrebnov,
    I did not have any time to fix this issue before.
    I just rebased previous commit and add a new one to synchronize changes with the global Windows Platform.
    Could you review please.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58215426
  
    Thank you, Maxime. I'll test updated version as soon as I have a chance (most likely in a few hrs) and let you know.  Thx!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18526729
  
    --- Diff: src/windows/FileProxy.js ---
    @@ -518,36 +518,69 @@ module.exports = {
             if (data instanceof ArrayBuffer) {
                 data = Array.apply(null, new Uint8Array(data));
             }
    -        
    -        var writePromise = isBinary ? Windows.Storage.FileIO.writeBytesAsync : Windows.Storage.FileIO.writeTextAsync;
     
    -        
             fileName = fileName.split("/").join("\\");
     
    -
             // split path to folder and file name
             var path = fileName.substring(0, fileName.lastIndexOf('\\')),
                 file = fileName.split('\\').pop();
    -        
     
             getFolderFromPathAsync(path).done(
                 function(storageFolder) {
                     storageFolder.createFileAsync(file, Windows.Storage.CreationCollisionOption.openIfExists).done(
                         function(storageFile) {
    -                        writePromise(storageFile, data).
    -                            done(function () {
    -                                win(data.length);
    -                            }, function () {
    -                                fail(FileError.INVALID_MODIFICATION_ERR);
    -                            });
    -                    }, function() {
    +                        if (data instanceof Blob || data instanceof File) {
    +                            storageFile.openAsync(Windows.Storage.FileAccessMode.readWrite).done(
    +                                function (output) {
    +                                    var input = data.msDetachStream();
    --- End diff --
    
    Are you sure ?
    File inherits from Blob, it should contain any methods defined in Blob prototype.
    http://msdn.microsoft.com/en-us/library/windows/apps/hh453178.aspx (Remarks section)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58274694
  
    Ok I understand that File is Cordova specific. Is there a way to access the blob inside the File Object ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18554367
  
    --- Diff: src/windows/FileProxy.js ---
    @@ -516,38 +556,50 @@ module.exports = {
                 isBinary = args[3];
     
             if (data instanceof ArrayBuffer) {
    -            data = Array.apply(null, new Uint8Array(data));
    +            var dataView = new DataView(data);
    +            data = new Blob([dataView]);
    --- End diff --
    
    Oh I didn't know that we can do this way, I will apply this fix tomorrow if you want.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18520973
  
    --- Diff: src/windows/FileProxy.js ---
    @@ -518,36 +518,69 @@ module.exports = {
             if (data instanceof ArrayBuffer) {
    --- End diff --
    
    I think we should remove this as well since  this is the same logic we are trying to get rid of - it will fail in case of large blob


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by SomaticIT <gi...@git.apache.org>.
Github user SomaticIT commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58153363
  
    Hi,
    Just to ask for review again. This bug is really blocking in Windows 8 application : the application crash with a __stackoverflow exception__ while trying to write files < 1 MB.
    Thanks


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by purplecabbage <gi...@git.apache.org>.
Github user purplecabbage commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-51885637
  
    Thanks for the github lesson @BBosman, extremely useful! I will use this lots.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#discussion_r18519168
  
    --- Diff: www/FileWriter.js ---
    @@ -100,9 +100,11 @@ FileWriter.prototype.write = function(data) {
         var that=this;
         var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
         var isBinary;
    +    var isWin8 = cordova.platformId === "windows8" || cordova.platformId === "windows";
     
         // Check to see if the incoming data is a blob
    -    if (data instanceof File || (supportsBinary && data instanceof Blob)) {
    +    if ((!isWin8 || !(data instanceof Blob || data instanceof File)) && // ignore if Windows 8
    --- End diff --
    
    this is very complicated to understand, could you please see if this could be made more human readable


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-51885991
  
    @Bosman, thx for sharing this trick!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-file pull request: CB-6994 - Windows 8 does not sav...

Posted by sgrebnov <gi...@git.apache.org>.
Github user sgrebnov commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/54#issuecomment-58388293
  
    merged, I'll do another round of testing this code on windows this week (or beginning of next week)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org