Direct share link for video


Nextcloud version (eg, 18.0.2): 18.0.4
Operating system and version (eg, Ubuntu 20.04): debian 10
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.38
PHP version (eg, 7.1): 7.3 fpm
SSL enabled

I’ve been fighting for days to install, configure and secure nextcloud.
Now that it’s over I find myself unable to do what I wanted to do.
I searched for hours on the forums without finding a result so I defer to you.
Sorry if a similar question exists and I just couldn’t find it.
Let us come to the heart of the matter.
I have two problems,

  • I am looking to create video sharing links to integrate them and watch them directly on my external site.
  • I do not know why but on the chrome / mozilla version of the desktop pc I cannot display the details of the video files.
    I get the following error message: Error while loading the file data.
    But on the phone it works without problem.
    I can however access the details of the other files on pc.

My English is limited so I used a translator. I hope this will remain understandable.

The output of your Nextcloud log in Admin > Logging:
I just replaced some part to hide the names

[no app in context] Error: OC\User\NoUserException: Backends provided no user object at <<closure>>

 0. <<closure>>
 1. /opt/dir1/dir2/lib/private/Files/Node/LazyRoot.php line 65
    call_user_func_array([OC\Files\Node\Root {},"getUserFolder"], [null])
 2. /opt/dir1/dir2/lib/private/Files/Node/LazyRoot.php line 282
    OC\Files\Node\LazyRoot->__call("getUserFolder", [null])
 3. /opt/dir1/dir2/apps/ransomware_detection/lib/Monitor.php line 140
 4. /opt/dir1/dir2/apps/ransomware_detection/lib/Events/FilesEvents.php line 122
    OCA\RansomwareDetection\Monitor->analyze(["/pixel/lab/vin ... "], 3)
 5. /opt/dir1/dir2/apps/ransomware_detection/lib/Events/FilesEvents.php line 86
    OCA\RansomwareDetection\Events\FilesEvents->analyze(["/pixel/lab/vin ... "], 3)
 6. /opt/dir1/dir2/apps/ransomware_detection/lib/FilesHooks.php line 79
    OCA\RansomwareDetection\Events\FilesEvents->onFileWrite({path: "/pixel/l ... "})
 7. /opt/dir1/dir2/lib/private/legacy/hook.php line 111
    OCA\RansomwareDetection\FilesHooks::onFileWrite({path: "/pixel/l ... "})
 8. /opt/dir1/dir2/apps/dav/lib/Connector/Sabre/File.php line 397
    OC_Hook::emit("OC_Filesystem", "post_write", {path: "/pixel/l ... "})
 9. /opt/dir1/dir2/apps/dav/lib/Connector/Sabre/File.php line 321
10. /opt/dir1/dir2/apps/dav/lib/Connector/Sabre/Directory.php line 156
11. /opt/dir1/dir2/3rdparty/sabre/dav/lib/DAV/Server.php line 1096
    OCA\DAV\Connector\Sabre\Directory->createFile("2020-05-11_php_CRUDPost.mkv", null)
12. /opt/dir1/dir2/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 525
    Sabre\DAV\Server->createFile("files/pixel/pix ... v", null, null)
13. <<closure>>
    Sabre\DAV\CorePlugin->httpPut(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
14. /opt/dir1/dir2/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPut"], [Sabre\HTTP\Requ ... }])
15. /opt/dir1/dir2/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    Sabre\Event\EventEmitter->emit("method:PUT", [Sabre\HTTP\Requ ... }])
16. /opt/dir1/dir2/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
17. /opt/dir1/dir2/apps/dav/lib/Server.php line 319
18. /opt/dir1/dir2/apps/dav/appinfo/v2/remote.php line 35
19. /opt/dir1/dir2/remote.php line 165
    require_once("/opt/dir1/zu ... p")

PUT /remote.php/dav/files/username/path/to/file/videos/2020-05-11_php_CRUDPost.mkv
from 2a01:cb18:80ff:bc00:a856:3260:bf83:cf5b by pixel at 2020-06-02T09:50:20+02:00

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

$CONFIG = array (
  'instanceid' => 'secret',
  'passwordsalt' => 'secret',
  'secret' => 'secret',
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/var/lib/dir1/dir2/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'secretsecret',
  'installed' => true,
  'connectivity_check_domains' => 
  array (
    0 => '',
    1 => '',
    2 => '',
    3 => '',
  'logtimezone' => 'Europe/Paris',
  'filelocking.enabled' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '',
    'port' => 6379,
    'timeout' => 10,
    'password' => 'secret',
    'dbindex' => 0,
  'cache_path' => '/var/lib/dir1/dir2/cache',
  'tempdirectory' => '/tmp/php/pHlhZYCnBns',
  'mount_file' => '/var/lib/dir1/dir2/data/mount.json',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  'twofactor_enforced_excluded_groups' => 
  array (
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'maintenance' => false,

The output of your Apache/nginx/system log in /var/log/____:
I do not have an error log at this time.

Thx for help


From what I can see, there are few things :

  • Many errors come from the app Ransomware Detection. Disable it to try.

  • You want to see a mkv video. mkv is not supported by browsers (neither NC ?). Convert it to mp4.

  • You try to look at an embeded video with a webdav link? So you need to enter your credentials to access your account.

  • You can’t embed a video in a web site with the share link. It may work if you use an extension like Sharing Path.


Great. Thanks.

1 Like

Also you can share folder and access files via URL without apps:

Thank you for your answers.
Sorry for the response time but I have tested your solutions before.
I have not managed to solve the problem of access to the details of certain videos.
I deleted the ransoware application but I still get the same error.
I tried to delete and resend but it doesn’t work.

For the problem of shared links I tried to use the Sharing Path application but when I add the share link in my html5 player I get the net message: ERR_TOO_MANY_REDIRECTS
For the webdav version I get an error 503.

To get around the problem I put a vhost which goes to the folder containing my videos and it works very well but I find it unfortunate that it does not work directly with nextcloud.

Thanks for your help.
I will continue to seek I do not like to leave on a defeat :).

Voici quelques images
2020-06-03 12_37_50-Shares - Nextcloud

By writing my answer I understood that I had a cross site problem.
Your two solutions work and I can finally access my files. So I have only the problem of “Error while loading the file data”.

With kind of file has an “Error while loading the file data” ?

This happens with mp4, flv, mkv video files.
It shows up when I try to view the details.
Just 96 bug videos, the rest worked fine and the details displayed.