WP-3692 Added code to check the streamlength before adding the document link