Uploading File Cancels After Navigating Away From Page

[details=“Support intro”]

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 12.0.2): 13
Operating system and version (eg, Ubuntu 17.04): Docker nextcloud image (latest) under Ubuntu 18 Server, using repository from Ubuntu Artful.
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1):

The issue you are facing:

First time poster and testing NextCloud, possible moving away from a QNAP completely. Issue is that when uploading files that take longer to sync, if you navigate away from the page where you are uploading them, the upload stops. I don’t see a progress bar anywhere. I do see an error possibly related in the Admin > Logging (posted below). I was testing with larger files, but it works with small files, such as 50mb. Sometimes I receive the error, sometimes I don’t. In all cases, the file never gets uploaded.

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

Steps to replicate it:

  1. Upload a file that will take some time to upload
  2. Navigate within Nextcloud to another page (Calender, Settings, any App, etc.)
  3. Come back to original page, progress bar gone, and file never uploads, even after waiting several hours

The output of your Nextcloud log in Admin > Logging:

	webdav	Sabre\DAV\Exception\BadRequest: expected filesize 10485760 got 6275072
/var/www/html/apps/dav/lib/Connector/Sabre/Directory.php - line 151: OCA\DAV\Connector\Sabre\File->put(Resource id #11)
/var/www/html/apps/dav/lib/Upload/UploadFolder.php - line 39: OCA\DAV\Connector\Sabre\Directory->createFile('0', Resource id #11)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 1096: OCA\DAV\Upload\UploadFolder->createFile('0', Resource id #11)
/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php - line 525: Sabre\DAV\Server->createFile('uploads/adminus...', Resource id #11, NULL)
[internal function] Sabre\DAV\CorePlugin->httpPut(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/3rdparty/sabre/event/lib/EventEmitterTrait.php - line 105: call_user_func_array(Array, Array)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 479: Sabre\Event\EventEmitter->emit('method PUT', Array)
/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php - line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))
/var/www/html/apps/dav/lib/Server.php - line 283: Sabre\DAV\Server->exec()
/var/www/html/apps/dav/appinfo/v2/remote.php - line 35: OCA\DAV\Server->exec()
/var/www/html/remote.php - line 164: require_once('/var/www/html/a...')
{main}

When you navigate away, does this mean to another page within the Nextcloud interface, or a completely different site?

I wonder if they could do something with Javascript to at least pop up a dialog warning that leaving the page will terminate the upload.

This is all within Nextcloud Interface. I tried Chrome, and have ad-blocking enabled.

I just tried in Firefox with no addons, and same issue.

  1. Upload a file, while in the Files page, that will take a minute or two to upload (50mb)
  2. Either wait a few seconds, or immediately click into a different page within Nextcloud, like Calendar, or the general settings, etc.
  3. Click back to the Files page, and the progress bar is gone. No file is uploaded. I get the error messages that the file size error posted above. I’ve also tried waiting several minutes/hours (for large files), never gets uploaded.

However, if I stay on the Files page while uploading, everything works correctly.

My intuition tells me, when you upload a file, it should upload, since it is doing so in the background, no matter what page within NextCloud you are on. However, it could be by design. . .

Appears same issue occurs on the Photos page as well.

BTW–Working off a fresh NC instance setup.

I think the problem has more to do with how websites work. Web applications are very different than desktop applications as far as multi tasking goes. If you navigate away from the page, you are requesting an entirely new thing from the server, and it cancels out whatever was happening before. There are some ways to work around this like warning that you are about to leave the page (those things are super annoying), having a separate window come up where you upload files (so the popup window stays open while you navigate in the main window), or something else like AJAX for navigation which I would bet would be a major refactoring and probably not worth the effort.

You should open a new issue on GitHub: https://github.com/nextcloud/server/issues

I just tested Dropbox, and prompts you if you attempt to navigate away from the page. If you select Leave, the upload cancels. Same thing for Drive. Maybe it should be more of a feature request, but I would think that unless you log out of close the browser, then the upload should continue. I guess it is more similar to how a browser works…you can close and open as many tabs as you want, but as long as you have the browser open, it continues to download.

Maybe this function would separate it from its competitors :wink:

I appreciate the quick response!

That’s for sure.
I definitely think it’s worth requesting this feature, since I wasn’t able to find anything like it on their issue tracker.