How to set up user only for upload?

I need to let users only for backup file but don’t have download or delete permission.

This script can not use now.

https://www.croix.at/blog/easy-nextcloud-file-drop-upload-using-powershell/

For ERROR 405

The tutorial you linked to is explaining the whole process, could you explain your problem any further? What did you try? When is an error occuring? Did you change $NextcloudUrl = "https://mynextcloudserver.at/xxx/"$sharetoken = 'Y4cQ2DLJeCAXRLD' to your data?

yes i did it but get 405 error code

Really? Nobody can helpt you, if you can’t describe what you are doing… HTTP code 405 is saying, that your script is using a method (PUT in this case) that is not allowed by the server.
What server are you using (self hosted, as service)? Did you try different links? Would you mind to show your script (anonymized! url and token)?

And maybe have a look at the update of the linked article from 16.09.2021:

Unfortunately, this solution no longer works. Something might have changed here.

$Item = “C:\backuplog\netlog.bat”
$NextcloudUrl = “http://10..0./index.php/s/”
$sharetoken = ‘*’

$Item = Get-Item $Item
$Headers = @{
“Authorization”=$(“Basic $([System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($(”$($sharetoken):"))))");
“X-Requested-With”=“XMLHttpRequest”;
}
$webdav = “$($NextcloudUrl)/public.php/webdav/$($Item.Name)”
Invoke-RestMethod -Uri $webdav -InFile $Item.Fullname -Headers $Headers -Method Put

with server error code

Invoke-RestMethod : 遠端伺服器傳回一個錯誤: (405) 不允許的方法。
位於 線路:1 字元:1

  • Invoke-RestMethod -Uri $webdav -InFile $Item.Fullname -Headers $Heade …
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod],WebException
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand