[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-31 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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)


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-23 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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. 


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-10 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-6994:
-

Commit cfcb74ca972134eb361fc89c7b419ad912b70972 in cordova-plugin-file's branch 
refs/heads/master from [~vladimir.kotikov]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file.git;h=cfcb74c ]

CB-6994 Fixes result, returned by proxy's write method

+ Refactors writeBlobAsync function
+ Fixes proxy's remove method failure when trying to delete non-existent file


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


Github user asfgit closed the pull request at:

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


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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)


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-08 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-6994:
-

Commit 055e7e0bde7d8580ec6c992b140fa5afbb3eda7e in cordova-plugin-file's branch 
refs/heads/master from sgrebnov
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file.git;h=055e7e0 ]

CB-6994 Improves merged code to be able to write a File


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-08 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on CB-6994:
-

Commit a631753eea52b315596b44f8028326318a821ff1 in cordova-plugin-file's branch 
refs/heads/master from sgrebnov
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file.git;h=a631753 ]

Merge remote-tracking branch 'maxime/CB-6994'


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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 ?


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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!



> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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!


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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;
}


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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)


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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 ...



> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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



> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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  wrote:
> 
> @sgrebnov Thanks
> 
> \
> Reply to this email directly or view it on GitHub.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


Github user SomaticIT commented on the pull request:

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


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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!


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-10-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org



[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-09-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-08-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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!


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-08-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-08-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-08-11 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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.


> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
> Fix For: 3.6.0
>
>
> 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.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CB-6994) Windows 8 does not save big file transferred using Blob

2014-06-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on CB-6994:


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 
Date:   2014-06-20T17:22:16Z

Fix function write for big files on windows 8




> Windows 8 does not save big file transferred using Blob
> ---
>
> Key: CB-6994
> URL: https://issues.apache.org/jira/browse/CB-6994
> Project: Apache Cordova
>  Issue Type: Bug
>  Components: Plugin File, Windows 8
>Affects Versions: 3.5.0
>Reporter: Maxime LUCE
>Assignee: Maxime LUCE
>
> When trying to save Blob using FileWriter.write method, getting a stack 
> overflow exception during the conversion of the blob into an basic array.
> WinRT (WinJS) provide a method to write Blob directly to the filesystem. It 
> uses Streams so it's safe for memory.
> More info at :
> http://code.msdn.microsoft.com/windowsapps/Blob-Sample-0e35889e/sourcecode?fileId=43594&pathId=962515806
> Method : writeBlobToFile



--
This message was sent by Atlassian JIRA
(v6.2#6252)