feat: add smb driver (close #1746) - #2114
Conversation
|
|
||
| func (d *SMB) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) { | ||
| fullPath := file.GetPath() | ||
| return &model.Link{FilePath: &fullPath}, nil |
There was a problem hiding this comment.
Is it correct to return the local file path here?
There was a problem hiding this comment.
Yes, I have tried to return the path with the prefix . and it gives a 500 error when directly browsing a file, which takes me some time to find out.
There was a problem hiding this comment.
But wouldn't that just return the native file only?
it is possible that smb on another machine.
There was a problem hiding this comment.
Sorry. I think I understand now.
SMB is mounted locally, right?
There was a problem hiding this comment.
My bad, I think I do not understand the meaning of the function, trying to fix it now.
There was a problem hiding this comment.
I think it works now for smb on another machine.
There was a problem hiding this comment.
Ok. This is function return one of three:
- path of native file
- download url of web file
- reader closer
For this, It maybe like:
f,_ := d.fs.Open(converted_path)
return &Link{
Data: f
}In a rough sense
|
Looks super - thank you. I wounld merge it after ci finished. |
|
非常感谢,我最近出于一些原因,把文件共享服务器从原来的 caddy webdav module 换成了 samba,这个 PR 正是我需要的。 |
|
今天试了下,好用!正好有这个需求。 |
No description provided.