We're deploying OSticket (uses Apache 2.4 & PHP-7.0-fpm) and want to hyperlink to network shared files (eg \\servername\foo) But this proves to be very difficult as this file is not in the webroot (amongst other limitations probably).

When using this link:

<a href="file:///\\servername\foo">foo</a>​

Does not open anyting. But copying the hyperlink to a new browser window does open the file.

Is there any possibility to establish hyperlinks to network shared files please?

  • Can't be done... you need to mount the SMB and then add it to the virtual host. File will always work internally on people's computers, not the server. Also... Windows is \\ and Mac/Linux is smb:\\ – Simon Hayter Jun 1 '18 at 12:41
  • I've mounted one test-directory with SMB under /mnt. But this is as the root user. If I want to have access with the site, I need to change the ACL's so that WWW-DATA has -rwx permissions as well as add it to the virtual host? That's why it can't be done? – WouterVE Jun 1 '18 at 13:21
  • What are you expecting the website to do when a user clicks the link? if you want a file list type browser, then you need to allow list indexing and you need to mount the SMB, then add the mount to the virtual host, then you need to add www-data group to access that mounted path. – Simon Hayter Jun 1 '18 at 13:38
  • I want to open the file (fi a pdf) so do I need to allow indexing in that case? By adding www-data group to the mounted path, the original ACL's are untouched? – WouterVE Jun 1 '18 at 14:08
  • 1
    No, you do not need indexing enabled if you are directly linking to the file. Mount the SMB e.g /media/smb guide here, then add a subdomain e.g smb.example.com then add a new virtual host for the subdomain with the path /media/smb, finally, just chown the path /media/smb to www-data:www-data then just add yourself to the www-data group to make uploads and changes. Then your PDF will be accessible using <a href="http://smb.example.com/eg.pdf>Download</a>. – Simon Hayter Jun 1 '18 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.