409 conflict when uploading files

Advertisement

Axel_RT
Joined:
Posts:
1
Location:
Reutlingen (Germany)

409 conflict when uploading files

Hello,
I have installed the WinSCP, Version is 6.1
Connected via WebDAV to our Nextcloud.
Always when I start the session from the desktop – it works fine.
I am always able to upload files (drag & drop).

But I have created a session in C# too
(using "WinSCP.exe" and "WinSCPnet.dll" from the same version 6.1).

In this case – the connection also seems to work.
Because the command session.Open(options) shows NO error.

But when this command is being executed
result = session.PutFiles(myLocalPath + myFileName, myRemotePath, false, transferoptions);
the error "409 conflict" occurs.

Here is the imoportant part of my code:
public ClassWinSCP(string thepath,string thefilename) 
{
    myLocalPath = @"L:\ITORG\2_Teamassistenz, Verwaltung\Teammitglieder\\goede\_AKTUELL\";
    myFileName = "*";
 
    string myRemotePath = "/nextcloud/public.php/webdav";
    string myLogfile = "Nextcloud-Upload.log";
    string myLogPath;
 
    Session session = new Session();
    SessionOptions options = new SessionOptions();
    TransferOptions transferoptions = new TransferOptions();
    TransferOperationResult result;
 
    myLogPath = myLocalPath + myLogfile;
    session.DebugLogPath= myLogPath;
 
    options.Protocol = Protocol.Webdav;
    options.HostName = "myserver";
    options.PortNumber= 9999;
    options.Secure= true;
    options.RootPath= myRemotePath;
    options.UserName = "XXXXXXXXX";
    options.Password = "YYYYYYYYY";
    session.Open(options);
    transferoptions.TransferMode = TransferMode.Binary;
 
    result = session.PutFiles(myLocalPath + myFileName, myRemotePath, false, transferoptions);
    result.Check();
}
Thanks for help!
Sincerely yours
Axel Goede

Reply with quote

Advertisement

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

Re: 409 conflict when uploading files

Please post full session logs file showing an upload of the same file to the same remote folder, both from GUI and the code.

Reply with quote

Advertisement

You can post new topics in this forum