开发者

Link to samba share

开发者 https://www.devze.com 2023-02-27 06:38 出处:网络
I have server with samba. Users have got share in it. I want make link from browser use tagto file on this share.

I have server with samba. Users have got share in it. I want make link from browser use tag to file on this share. How it mak开发者_如何学Goe it? I try:

<a href="file://///sambaserver/user1/file1.mp3">file1.mp3</a>

I try mount share to windows and make link to this share:

<a href="file:///user1/file1.mp3">file1.mp3</a>

And I try mount share like a disk and try to access:

<a href="file://z:/file1.mp3">file1.mp3</a>

Is it possible to make link to samba share? File which have link to samba share locate on local server. http://sambaserver/index.php


The file:// scheme always points at the user's computer, not the server.

Using your example above where you have the samba share mounted as the z: drive you'd need to add the following to your httpd.conf file:

Alias /samba z:\

<Directory z:\>
   Options Indexes FollowSymLinks MultiViews
   Order allow,deny
   allow from all  
</Directory>

Then your link would look like this:

<a href="/samba/file1.mp3">file1.mp3</a>

Here's a forum posting about the topic on Linux as a reference: http://www.linuxquestions.org/questions/linux-newbie-8/apache-alias-samba-share-to-a-windows-box-546891/


I would think you could link like this in an email using the IP address. it has worked for me in other applications, but I've not used email. I've had issues using the NT alias for the address like sambaserver above with our version of HP UNIX. It, just doesn't seem to work with HP UNIX. The big issue I see, is the authentication issue. Windows and UNIX authentication are entirely separate and in our company handled by different groups which don't talk to each other and have different policies. It's doubtful that you will be able to have anonymous allowed to do anything on your Samba box. What I will probably have to do, which I have done in the past, is drop my files on a windows share open to everyone( they can only drop files and can't read them) and then have a batch file with my windows userid pick them up and drop them on the UNIX box. This will work.

0

精彩评论

暂无评论...
验证码 换一张
取 消