How to automatically remove incomplete file uploads in Nextcloud 14?

Geir asked:

Just installed a fresh Nextcloud 14, concluding some testing before putting it into production, including upload of large files through the Web UI.

Being impatient I started clicking around while waiting for a ~1Gb file to finish uploading, oblivious to the fact that uploads are interrupted when you do that.

So I had to start over again, and continued clicking around in another tab. Not keeping my tabs organized, this happended several times..

During attempt 5 of the upload I got curious as to how Nextcloud actually deals with interrupted uploads and started poking around in the file system and found the following:

Incomplete files are kept in <user-folder>/uploads, and moved to <user-folder>/files when complete.

However, aborted uploads, e.g due to “clicking around” don’t seem to be removed automatically.

Here are my first 4 attempts to upload the file:

[email protected] .../admin/uploads# du -sh *
41M web-file-upload-223ed330e5adb988a8963b52027a9a7c-1541719636278
601M web-file-upload-223ed330e5adb988a8963b52027a9a7c-1541720062948
8.0K web-file-upload-223ed330e5adb988a8963b52027a9a7c-1541721459579
731M web-file-upload-223ed330e5adb988a8963b52027a9a7c-1541721472847

So yes, easy to clean up, but really annoying. Can this be automated?

My answer:


An open GitHub issue suggests that these interrupted uploads will be cleaned up when you log out and log back in. The issue says that this will eventually be moved to a background job, so it will happen automatically in a future version of Nextcloud.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.