Upload file using WebDAV protocol fails
I'm developing a .NET core app (no GUI, just a service that runs jobs once in a while). It checks if a file exists on a WebDAV folder, if not, it copies the file to the target.
I am able to list the files in the WebDAV folder (When Debugging, I can see the list of fetched files).
I use WinSCP NuGet version 5.21.5 (currently the latest)
However, when I try to upload the file using
session.PutFileToDirectory
, I get the following error:
=> '**' was not the host I configured for the session. I also cannot see the file on the target folder, it clearly failed. But I cannot see what went wrong. Can you please assist?Error transferring file 'C:\dev\ConfiDesk\confidesk-api\Confidesk.Api\LocalTmpStorage\CDA128-20221118-OR1TMAA19K.TXT'.
WebDAV resource moved to '**'.
302 Moved Temporarily
In order to give you more feedback, I attached a debugLog (I tried also creating a session log by setting the
SessionLogPath
, but the logfile does not get created.
In the debuglog file, you can see, before the mention of 302 Moved temporarily, there is a mention of 502 Bad Gateway. Maybe this points to the actual problem?
Please let me know if you need any more information.
Thank you!