pre-upload action: add file open flags

Reading the flags the hook receiver can detect if the client wants to
truncate the target file
This commit is contained in:
Nicola Murino
2021-05-31 22:33:23 +02:00
parent c63b923ec3
commit c1239fbf59
10 changed files with 33 additions and 26 deletions

View File

@@ -148,7 +148,7 @@ func (f *webDavFile) Read(p []byte) (n int, err error) {
return 0, f.Connection.GetPermissionDeniedError()
}
err := common.ExecutePreAction(&f.Connection.User, common.OperationPreDownload, f.GetFsPath(), f.GetVirtualPath(),
f.Connection.GetProtocol(), 0)
f.Connection.GetProtocol(), 0, 0)
if err != nil {
f.Connection.Log(logger.LevelDebug, "download for file %#v denied by pre action: %v", f.GetVirtualPath(), err)
return 0, f.Connection.GetPermissionDeniedError()