Can I display the actual upload speed in the web interface?

Hi All,

I came across this while looking for the same thing.

I couldn’t find an answer to this so looked into it and this is how I got it working.

Nextcloud 14.0.4 / Ubuntu 18.04.1 LTS + MATE

All we are going to do is add lines to a file which will replace the displayed time remaining data with upload data.

Method - you’ll need admin access for this:

  1. goto the folder of the file location:

    cd /var/www/html/nextcloud/apps/files/js/
    
  2. make a backup copy of the upload file

    sudo cp file-upload.js file-upload.js-original
    
  3. edit the upload file

    sudo nano file-upload.js
    

    I’m using nano text editor, use whatver floats your boat

  4. NB: in nano - pressing Ctrl + C will show you the current line number, and Alt + G will prompt for a line number to jump to

    goto line 1139, you want to find this line:

    var h = moment.duration(smoothRemainingSeconds, "seconds").humanize();
    if (!(smoothRemainingSeconds >= 0 && smoothRemainingSeconds < 14400)) {
    		// show "Uploading ..." for durations longer than 4 hours
    		h = t('files', 'Uploading …');
    }
    

    this is displaying the upload information

  5. after the above line add one of the following as required:

    a) xfr speed after the time remining:

time%20remianing%20and%20transfer%20speed

		// add xfr speed to time remaining
		h = h + t('files', ' @ {bitrate}' , {
					bitrate: humanFileSize(data.bitrate / 8) + '/s'
				});
		// ========================================
	
b)	xfr speed replaces time remaining:

transfer%20speed

		// xfr speed replaces time remaining
		h = t('files', '{bitrate}' , {
					loadedSize: humanFileSize(data.loaded),
					totalSize: humanFileSize(data.total),
					bitrate: humanFileSize(data.bitrate / 8) + '/s'
				});
		// ========================================
	
c)	uploaded of total size and xfr speed replaces time remaining:

(image would be as per Marcel_Panac's above)

		// uploaded of total size and xfr speed replaces time remaining
		h = t('files', '{loadedSize} of {totalSize} ({bitrate})' , {
					loadedSize: humanFileSize(data.loaded),
					totalSize: humanFileSize(data.total),
					bitrate: humanFileSize(data.bitrate / 8) + '/s'
				});
		// ========================================

To return to the original display, comment out or delete the added lines.

:slight_smile: