I am currently using this session options
var sessionOptions = new SessionOptions
{
Protocol = Protocol.Webdav,
WebdavSecure = true,
PortNumber = 443,
HostName = hostname,
UserName = username,
Password = password,
};
The hostname format is something like:
example.com/fileshare/remote.php/dav/files/
The connection was successful but when I tried using any method inside (e.g.
PutFiles
) I kept on getting the 404 error. The suspicions rose from when I do the following:-
I tried adding the
RootPath
but it wont change to the desired folder:
Error:
Error changing directory to '/TMUser'
Then I check for the homepath:
/fileshare/remote.php/dav/files/:443
and I realised I saw this when using the GUI too, what I did when using the GUI was change the directory using the 'Open Directory' button from
/fileshare/remote.php/dav/files/:443
to
/fileshare/remote.php/dav/files/TMUser
and succeed. Is there any options to do these inside the code?
Btw I just found this library a few hours ago.
Server is using Centos 7, and yes the port used is 80 inside the server but was set to 443 via router. I just finished searching a bit, so the issue is probably because of WinSCP lack concept of working directory? So I need to use the absolute path? hmm..
So something like this?
/var/www/fileshare/data
I tried, and got error
405 Method Not Allowed
hmmmm.. maybe im missing something but I'm not sure what it is.