SessionOptions.RootPath for WebDav does not work

Advertisement

chrislong98
Joined:
Posts:
4

SessionOptions.RootPath for WebDav does not work

Hi Martin,
You apparently obsoleted WebdavRoot and you say to use RootPath in its place, however, RootPath is not working for me here with WebDAV in 5.17.10. WebdavRoot no longer works either (that's what I was previously using). I can't get the root folder changed with the .NET assembly for WebDAV. The GUI works setting the remote folder on the server, but I can't do it via code with the assembly any more (pretty sure it's not a problem with my code - I literally just changed the previously working SessionOptions.WebdavRoot = "/myfolder" to SessionOptions.RootPath = "/myfolder". Same server, same folder. I can do it in GUI but not via code. The log shows that it just treats it as if it wasn't set and uses "/" as in:
". 2021-06-15 16:00:27.190 OPTIONS / HTTP/1.1"
Chris

Reply with quote

Advertisement

chrislong98

Sorry, my fault

Martin, Sorry for this. You can ignore. I would not have posted if I had not thought it was a bug, but it turns out this indeed appears to be a problem on my end. I haven't resolved yet but I can see that despite what I thought, that my previous usage of WebdavRoot never worked either and I have discovered the reason why. So sorry for posting! I'm usually good about ensuring it's not me before doing so. Thank you again for WinSCP!! :) Regards, Chris

Reply with quote

chrislong98
Joined:
Posts:
4

One quick question

Martin, sorry to bother you, but one quick question. In my testing with WebDAV where a root is specified via RootPath and the connection opened to that root, I was surprised then to discover that I also had to specify that same root again when uploading files. I would have thought since the server connection was opened to that root path, that that was then the established root and everything else would be relative to it.
For instance, root path set to "/mysubfolder" in SessionOptions. Session started with /mysubfolder as the root. If I then use PutFiles etc, why do I again have to specify /mysubfolder in the destination? Wasn't the connection already started with that root?
I don't care, but just want to make sure I know what is what. Bottom line question: Does WinSCP always require any specified RootPath (for either WebDav or S3) to again be specified when putting/deleting files?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: One quick question

The only point of the RootPath is that when WinSCP validates the connection with the stateless protocols like WebDAV and S3, it needs to do it against a folder that is actually accessible (or even supports the protocol). It has no effect later on.

https://winscp.net/eng/docs/library_sessionoptions#rootpath:
Set, when the HTTP server root or S3 bucket list is not accessible.

Reply with quote

Advertisement

You can post new topics in this forum