Next Cloud Amazon S3 Limitation over WebDAV

Nextcloud version (eg, 12.0.2): 13.0.1
Operating system and version (eg, Ubuntu 17.04):Ubuntu 16.04.3 LTS
Apache or nginx version (eg, Apache 2.4.25): 2.4.18
PHP version (eg, 7.1): 7.0.28

The issue you are facing:

When I attempt to upload a large (5GB) file via WebDAV (WinSCP), the file gets to 1.43GB and Nextcloud closes the connection. Uploading the same file via drag and drop in the web browser works.

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

  1. Connect WebDAV via WinSCP and Transfer a file

The output of your Nextcloud log in Admin > Logging:

|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:36:12-0400|
|---|---|---|---|
|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:36:12-0400|
|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:36:12-0400|
|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:36:12-0400|
|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:35:51-0400|
|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:35:51-0400|
|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:35:51-0400|
|Error|PHP|Invalid argument supplied for foreach() at /var/www/html/nextcloud/apps/files_external/lib/Lib/Storage/AmazonS3.php#295|2018-03-27T20:35:51-0400|
|Fatal|webdav|Sabre\DAV\Exception: Error while copying file to target location (copied bytes: 2995453952, expected filesize: 5400115200 )|2018-03-27T17:29:03-0400|

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'ocyyos7poc0f',
  'objectstore' =>
  array (
    'class' => 'OC\\Files\\ObjectStore\\S3',
    'arguments' =>
    array (
      'bucket' => 'storage',
      'autocreate' => true,
      'key' => 'xx',
      'secret' => 'xx',
      'hostname' => 's3.amazonaws.com',
      'use_ssl' => true,
      'region' => 'us-east-2',
    ),
  ),
  'passwordsalt' => 'xx',
  'secret' => 'xx',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => 'storage.domain.com',
  ),
  'datadirectory' => '/var/www/html/nextcloud/data',
  'overwrite.cli.url' => 'http://storage.domain.com',
  'dbtype' => 'mysql',
  'version' => '13.0.1.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_Acct',
  'dbpassword' => 'xx',
  'installed' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  #'memcache.locking' => '\\OC\\Memcache\\Redis'
'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 1.5,
  ),
  'maintenance' => false,
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
);