aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-31 19:57:14 +0000
committerMario <mario@mariovavti.com>2020-10-31 19:57:14 +0000
commitd59b81f11df990c7710378f9d9b0341fc89276e9 (patch)
treeb99a74c5f16b1f373d75dcec90dbf964ba6fe361 /include
parentb11d2c376b130b33589f381be9d5d55b32d9a7cb (diff)
downloadvolse-hubzilla-d59b81f11df990c7710378f9d9b0341fc89276e9.tar.gz
volse-hubzilla-d59b81f11df990c7710378f9d9b0341fc89276e9.tar.bz2
volse-hubzilla-d59b81f11df990c7710378f9d9b0341fc89276e9.zip
if restarting a previously interrupted upload just return where we ended - fix issue #1485
Diffstat (limited to 'include')
-rw-r--r--include/attach.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/attach.php b/include/attach.php
index 80f71b9ea..c9649a4ce 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -2807,6 +2807,12 @@ function save_chunk($channel,$start,$end,$len) {
$new_path = $new_base . '/' . $_FILES['files']['name'];
+ if(file_exists($new_path) && intval($start) === 0) {
+ $result['partial'] = true;
+ $result['length'] = intval(filesize($new_path));
+ return $result;
+ }
+
if(! file_exists($new_path)) {
rename($tmp_path,$new_path);
}