Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Grégory Catto

Resolve WebDav 405 Method not allowed problem in WinSCP

In the WinSCP parameters, you can try to set the true TLS/SSL version of the server.
Try TLS 1.1 to 1.2. It can resolve the problem
martin

supermankelly wrote:

why is the generated code still broken for WebDAV?

It's not broken.
There's no way WinSCP can know that the root is not accessible with WebDAV.
supermankelly

I wish I has found this yesterday. I spent half the day working this out myself. Mine only worked with user password also which is also missing from generated code.

This was post was raised 2 years ago... why is the generated code still broken for WebDAV?
Guest

Hi Martin,

you were absolutely right.

By adding

RootPath = "/remote.php/webdav"


to the Powershell script or adding the root folder to the batch code:

open davs://user:password@cloud.xxxxxx.com/remote.php/webdav


winscp successfully connects to WebDav Service.

Thank you for your quick help :D
StewieGriffin

Webdav script 405 Method Not Allowed

When used over GUI everything works fine. When you open an already existing Session in a batch script everything works fine.

But when you generate your session code to do a batch or powershell script the "405 Method not allowed" error is shown.

Here is a working example:

option batch on

option confirm off
open CloudSession
lcd test
cd test
get *.*
close
exit


When i connect to the session via gui and generate a session code it looks like this:

open davs://user:password@cloud.xxxxxx.com/


When connecting with winscp.com:

winscp> open davs://user:password@cloud.xxxxxx.com/

Verbinde mit entferntem Rechner...
405 Method Not Allowed
Verbindung fehlgeschlagen.
winscp>


Same error on this Powershell code:

# WinSCP .NET assembly laden

Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"

# Sitzungsoptionen konfigurieren
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
    Protocol = [WinSCP.Protocol]::Webdav
    HostName = "cloud.xxxxxx.com"
    PortNumber = 443
    UserName = "user"
    Password = "password"
    WebdavSecure = $True
    TlsHostCertificateFingerprint = "00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00"
}

$session = New-Object WinSCP.Session

Ausnahme beim Aufrufen von "Open" mit 1 Argument(en): "405 Method Not Allowed Verbindung fehlgeschlagen."


Any ideas what could be wrong here?