[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user 2garryn commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-166144544 Ping @maortega --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user daserge commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-162800441 Ping @maortega... --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user daserge commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-159499456 @stevengill, There are some questions and proposals on improvement for this PR - I believe they should be addressed first. This is a new feature so it has a lower priority than existing bugs, which I'm looking into now. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user stevengill commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-159452714 @daserge thoughts on merging this? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user daserge commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-158332458 Also the test should be extended to verify the data received by [the server](https://github.com/apache/cordova-labs/blob/0987a423d8ba82901a39caf9d1c013f06192e83d/server.js#L37) - it echoes the received file params back so at least we can verify the file length now (see [verifyUpload function](https://github.com/apache/cordova-plugin-file-transfer/blob/97031b2d7528033c82bdff4659b9041dd9512a51/tests/tests.js#L696)) and we should also verify the contents IMO. The server responds back like this now: ``` {"fields":{},"files":{"file":{"size":17,"path":"C:\\Users\\SERGEY~1.SHA\\AppData\\Local\\Temp\\upload_d2fac85e424cb5bda30b5cb5900978f7","name":"fileToUpload.txt","type":null,"mtime":"2015-11-19T16:38:41.038Z"}}} ``` --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user daserge commented on a diff in the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#discussion_r45447454 --- Diff: src/ios/CDVFileTransfer.m --- @@ -259,13 +259,35 @@ - (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData CFRelease(writeStream); }]; } else { +NSNumber* startByte = (NSNumber*)[command argumentAtIndex:11 withDefault:0]; +NSNumber* endByte = (NSNumber*)[command argumentAtIndex:12 withDefault:0]; + +NSInteger i_startByte = [startByte integerValue]; +NSInteger i_endByte = [endByte integerValue]; + +if(i_endByte == 0){ +i_endByte = -1; +} +NSRange chunkRange = NSMakeRange(i_startByte, i_endByte-i_startByte); +NSData* chunkData = [fileData subdataWithRange:chunkRange]; + if (multipartFormUpload) { -[postBodyBeforeFile appendData:fileData]; +[postBodyBeforeFile appendData:chunkData]; +//[postBodyBeforeFile appendData:fileData]; [postBodyBeforeFile appendData:postBodyAfterFile]; [req setHTTPBody:postBodyBeforeFile]; } else { -[req setHTTPBody:fileData]; +[req setHTTPBody:chunkData]; +//[req setHTTPBody:fileData]; } + +// if (multipartFormUpload) { +// [postBodyBeforeFile appendData:fileData]; +// [postBodyBeforeFile appendData:postBodyAfterFile]; +// [req setHTTPBody:postBodyBeforeFile]; +// } else { +// [req setHTTPBody:fileData]; +// } --- End diff -- Please remove unnecessary comments. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user daserge commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-158329499 Hi @maortega, thanks for the contribution! A few notes on this: * I believe it is better to move new parameters to [`FileUploadOptions`](https://github.com/apache/cordova-plugin-file-transfer/blob/97031b2d7528033c82bdff4659b9041dd9512a51/www/FileTransfer.js#L98), * Can we move the args to the optional [Content-Range](https://tools.ietf.org/html/rfc7233#page-12) header? * Can you please explain when are you sending `startByte` and `endByte` params in the POST? I can't see it in the code. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user maortega commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-158229415 Sure, test added. --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
Github user stevengill commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116#issuecomment-158201106 Could you add a test for this new usecase? --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-10044 FileTransfer p...
GitHub user maortega opened a pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/116 CB-10044 FileTransfer plug in can upload parts of a file to implement resumablejs By sending the startByte and endByte to the FileTransfer plugin we are able to upload parts of a file therefore we can integrate this with ResumableJS You can merge this pull request into a Git repository by running: $ git pull https://github.com/maortega/cordova-plugin-file-transfer master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-file-transfer/pull/116.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 #116 commit 2cf7acb9023bedc6d23e7ff765a78522b1677d5a Author: MARCO ANTONIO ORTEGA Date: 2015-11-18T20:36:33Z Optionally receive startByte and endByte commit 824a5b223d02e12ab21430184486ed3d4b3ca7cc Author: MARCO ANTONIO ORTEGA Date: 2015-11-19T16:37:05Z Use byte range to send a portion of a file to be able to be compatible with resumablejs commit 38cc769dc92b7f32e727021508b535f3ba42e402 Author: MARCO ANTONIO ORTEGA Date: 2015-11-19T16:47:19Z Send byte range of file. commit 8a642151a16c0aa275adf5b971b180c964e9bb8d Author: MARCO ANTONIO ORTEGA Date: 2015-11-19T16:47:31Z Merge branch 'feature/Accept_file_ranges' into develop commit 33774fd8c8b1b493a92fd6dc5bcaf531ab7c6371 Author: MARCO ANTONIO ORTEGA Date: 2015-11-19T16:49:41Z Merge branch 'release/1.1' --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org