Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 969BC1791B for ; Fri, 13 Feb 2015 00:21:16 +0000 (UTC) Received: (qmail 17065 invoked by uid 500); 13 Feb 2015 00:21:16 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 17027 invoked by uid 500); 13 Feb 2015 00:21:16 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 17015 invoked by uid 99); 13 Feb 2015 00:21:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2015 00:21:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mike@ustadmobile.com designates 88.198.162.115 as permitted sender) Received: from [88.198.162.115] (HELO svr1.ustadmobile.com) (88.198.162.115) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Feb 2015 00:20:51 +0000 Received: by svr1.ustadmobile.com (Postfix, from userid 33) id 4D39628E26B; Fri, 13 Feb 2015 01:20:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ustadmobile.com; s=mail; t=1423786819; bh=OgtaLgA19kvWurBTgyVDl7SE2w9xJQB5CJL/AABLL/c=; h=To:Subject:Date:From:From; b=H88LEamwlcmlvscBxPwb7wWR84daPA1fY44vb35pLdvOlYhlGcgeYAK/Ip8++i/zH zZOlOcqiPZbbu+kTmaoU68UpclONiZRi8XkBqyKw+3K99pS0OcafdaMD8PkcXS4wID Qh93U5Fj58oXdlYTziW7uOV2YwcKANTkQoY/BAoY= To: Subject: CB-8471: Impossible to resume FileTransfer X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 13 Feb 2015 01:20:19 +0100 From: Mike Dawson Message-ID: X-Sender: mike@ustadmobile.com User-Agent: Roundcube Webmail/0.7.1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, This has been discussed briefly before: http://mail-archives.apache.org/mod_mbox/cordova-dev/201311.mbox/%3CCAK_TSX+dKpLr7vCCacN9kMv1d0=WN2z1DfapheyEam3R_DVG1Q@mail.gmail.com%3E Problem is when using the FileTransfer plugin to download a file, if the file is interrupted it will get automatically deleted. This is what happens on Android (FileTransfer.java line 948): // Remove incomplete download. if (!cached && result.getStatus() != PluginResult.Status.OK.ordinal() && file != null) { file.delete(); } This will make it impossible to resume from where the file left off, and on many networks/situations for a lot of people in countries / areas where the networks are not so good the probability of ever succeeding at downloading a sizeable (e.g. 30MB+) file will be very low and it would waste a lot of bandwidth. It is true that resume is a complex business and perhaps out of the scope of such a plugin (what happens when file changes, how many retries, etc). If we had just an option like keepIncompleteDownload which would default to false this (ie. keep the current behaviour) would allow developers to implement their own logic in Javascript to handle resume if they wish to - e.g. try the download again, sending a range header, to another file and at the end concatenate all the file pieces together. I have to make a working version of this behaviour for an app we currently develop just for Android; so I can write that behaviour there. I don't see any tests that describe the desired behaviour in this scenario. Would be interested to see if anyone else has any alternative suggestions. Regards, -Mike --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org For additional commands, e-mail: dev-help@cordova.apache.org