[jira] [Commented] (CB-2183) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
[ https://issues.apache.org/jira/browse/CB-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13552419#comment-13552419 ] William Wong commented on CB-2183: -- Andrew, in my case, files downloaded from file:///.../www/ could be binaries (e.g. PNGs). It would be great if we can use standard FileSystem APIs. To obsolete FileTransfer and use standard HTML5 File APIs, PhoneGap will need to implement few things around HTML5 Blob: - HTTP (via XHR) - file:/// - Sends Blob downloaded by XHR to native - FYI, ArrayBuffer (http://www.khronos.org/registry/typedarray/specs/latest/#5) may give you some hints how to convert Blob - DOM String, but looks like it won't be an efficient approach - file:///.../Documents - HTTP (via XHR) - (*) Implements FileReader.readAsArrayBuffer(Blob), or ask the user to use Data URI and convert to Blob (http://stackoverflow.com/questions/4998908/convert-data-uri-to-file-then-append-to-formdata) - file:///.../www/ - file:///.../Documents - Implements (*) - Implements FileWriter.write(Blob), currently PhoneGap only support FileWriter.write(utf8) If the bridge can handle Blob objects, and implement FileWriter.write(Blob) correctly, we should be able to obsolete FileTransfer. [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse -- Key: CB-2183 URL: https://issues.apache.org/jira/browse/CB-2183 Project: Apache Cordova Issue Type: Bug Components: iOS Affects Versions: 2.2.0 Environment: Tested on iOS 5.1 and 6.0 Reporter: William Wong Assignee: Shazron Abdullah Priority: Minor Labels: File, FileTransfer Fix For: 2.4.0 When FileTransfer.download() is downloading a file from file:///, NSURLConnection did not return with NSHTTPURLResponse. This will fail for apps that copy files from www/, e.g. apps that initialize its database from a pre-built cache packaged in IPA. In CB-1600 (fixed in 2.2.0), the fix assumes all response must be NSHTTPURLResponse. So when FileTransfer.download() is downloading from a file:/// URL (e.g. copying file from www/ folder to Documents/), FileTransfer assumed the download operation failed and returned 403. Tested if we comment out CB-1600, downloading from file:/// works again. We need to find out a better fix instead of commenting out CB-1600. According to http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/1165i, URL of file:/// is supported. You can test FileTransfer.download() by calling it with encodeURI(document.location.href) as the source parameter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2183) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
[ https://issues.apache.org/jira/browse/CB-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13551183#comment-13551183 ] Andrew Grieve commented on CB-2183: --- To be clear, I do think we should fix this. I'm also wondering though if you can accomplish what you're trying to do using the FileSystem API? [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse -- Key: CB-2183 URL: https://issues.apache.org/jira/browse/CB-2183 Project: Apache Cordova Issue Type: Bug Components: iOS Affects Versions: 2.2.0 Environment: Tested on iOS 5.1 and 6.0 Reporter: William Wong Assignee: Shazron Abdullah Priority: Critical Labels: File, FileTransfer Fix For: 2.4.0 When FileTransfer.download() is downloading a file from file:///, NSURLConnection did not return with NSHTTPURLResponse. This will fail for apps that copy files from www/, e.g. apps that initialize its database from a pre-built cache packaged in IPA. In CB-1600 (fixed in 2.2.0), the fix assumes all response must be NSHTTPURLResponse. So when FileTransfer.download() is downloading from a file:/// URL (e.g. copying file from www/ folder to Documents/), FileTransfer assumed the download operation failed and returned 403. Tested if we comment out CB-1600, downloading from file:/// works again. We need to find out a better fix instead of commenting out CB-1600. According to http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/1165i, URL of file:/// is supported. You can test FileTransfer.download() by calling it with encodeURI(document.location.href) as the source parameter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2183) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
[ https://issues.apache.org/jira/browse/CB-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13551465#comment-13551465 ] Shazron Abdullah commented on CB-2183: -- I thought Patrick's patch was iOS 4.3 specific that's why I suggested removing it since removing it fixes this problem (and would be easiest I suppose) -- but let's do this correctly as you suggested [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse -- Key: CB-2183 URL: https://issues.apache.org/jira/browse/CB-2183 Project: Apache Cordova Issue Type: Bug Components: iOS Affects Versions: 2.2.0 Environment: Tested on iOS 5.1 and 6.0 Reporter: William Wong Assignee: Shazron Abdullah Priority: Minor Labels: File, FileTransfer Fix For: 2.4.0 When FileTransfer.download() is downloading a file from file:///, NSURLConnection did not return with NSHTTPURLResponse. This will fail for apps that copy files from www/, e.g. apps that initialize its database from a pre-built cache packaged in IPA. In CB-1600 (fixed in 2.2.0), the fix assumes all response must be NSHTTPURLResponse. So when FileTransfer.download() is downloading from a file:/// URL (e.g. copying file from www/ folder to Documents/), FileTransfer assumed the download operation failed and returned 403. Tested if we comment out CB-1600, downloading from file:/// works again. We need to find out a better fix instead of commenting out CB-1600. According to http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/1165i, URL of file:/// is supported. You can test FileTransfer.download() by calling it with encodeURI(document.location.href) as the source parameter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2183) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
[ https://issues.apache.org/jira/browse/CB-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13550485#comment-13550485 ] Shazron Abdullah commented on CB-2183: -- Confirmed on a device. Note that there are different results on device vs simulator - the Simulator does not exhibit the same behaviour (the didReceiveResponse selector is never called for a file:// url) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse -- Key: CB-2183 URL: https://issues.apache.org/jira/browse/CB-2183 Project: Apache Cordova Issue Type: Bug Components: iOS Affects Versions: 2.2.0 Environment: Tested on iOS 5.1 and 6.0 Reporter: William Wong Assignee: Shazron Abdullah Priority: Critical Labels: File, FileTransfer When FileTransfer.download() is downloading a file from file:///, NSURLConnection did not return with NSHTTPURLResponse. This will fail for apps that copy files from www/, e.g. apps that initialize its database from a pre-built cache packaged in IPA. In CB-1600 (fixed in 2.2.0), the fix assumes all response must be NSHTTPURLResponse. So when FileTransfer.download() is downloading from a file:/// URL (e.g. copying file from www/ folder to Documents/), FileTransfer assumed the download operation failed and returned 403. Tested if we comment out CB-1600, downloading from file:/// works again. We need to find out a better fix instead of commenting out CB-1600. According to http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/1165i, URL of file:/// is supported. You can test FileTransfer.download() by calling it with encodeURI(document.location.href) as the source parameter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2183) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
[ https://issues.apache.org/jira/browse/CB-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13550494#comment-13550494 ] Shazron Abdullah commented on CB-2183: -- I proposed on CB-1600 that we revert that patch since it only applies to iOS 4.3, and we only support iOS 5.0 and greater now. [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse -- Key: CB-2183 URL: https://issues.apache.org/jira/browse/CB-2183 Project: Apache Cordova Issue Type: Bug Components: iOS Affects Versions: 2.2.0 Environment: Tested on iOS 5.1 and 6.0 Reporter: William Wong Assignee: Shazron Abdullah Priority: Critical Labels: File, FileTransfer When FileTransfer.download() is downloading a file from file:///, NSURLConnection did not return with NSHTTPURLResponse. This will fail for apps that copy files from www/, e.g. apps that initialize its database from a pre-built cache packaged in IPA. In CB-1600 (fixed in 2.2.0), the fix assumes all response must be NSHTTPURLResponse. So when FileTransfer.download() is downloading from a file:/// URL (e.g. copying file from www/ folder to Documents/), FileTransfer assumed the download operation failed and returned 403. Tested if we comment out CB-1600, downloading from file:/// works again. We need to find out a better fix instead of commenting out CB-1600. According to http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/1165i, URL of file:/// is supported. You can test FileTransfer.download() by calling it with encodeURI(document.location.href) as the source parameter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CB-2183) [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse
[ https://issues.apache.org/jira/browse/CB-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13550802#comment-13550802 ] William Wong commented on CB-2183: -- According to Apple doc, 4 types of protocol need to be handled: http, https, ftp, and file. [iOS] FileTransfer.didReceiveResponse may not return NSHTTPURLResponse -- Key: CB-2183 URL: https://issues.apache.org/jira/browse/CB-2183 Project: Apache Cordova Issue Type: Bug Components: iOS Affects Versions: 2.2.0 Environment: Tested on iOS 5.1 and 6.0 Reporter: William Wong Assignee: Shazron Abdullah Priority: Critical Labels: File, FileTransfer Fix For: 2.4.0 When FileTransfer.download() is downloading a file from file:///, NSURLConnection did not return with NSHTTPURLResponse. This will fail for apps that copy files from www/, e.g. apps that initialize its database from a pre-built cache packaged in IPA. In CB-1600 (fixed in 2.2.0), the fix assumes all response must be NSHTTPURLResponse. So when FileTransfer.download() is downloading from a file:/// URL (e.g. copying file from www/ folder to Documents/), FileTransfer assumed the download operation failed and returned 403. Tested if we comment out CB-1600, downloading from file:/// works again. We need to find out a better fix instead of commenting out CB-1600. According to http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/1165i, URL of file:/// is supported. You can test FileTransfer.download() by calling it with encodeURI(document.location.href) as the source parameter. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira