WinSCP.SessionRemoteException: C:\path\file.zip is not file!

Advertisement

stijacicn
Joined:
Posts:
5
Location:
sweden

WinSCP.SessionRemoteException: C:\path\file.zip is not file!

Hello,

I need your help! I have made a custom WinSCP PowerShell script that I am calling everyday... Few days ago I notice that script started to fail with error
WinSCP.SessionRemoteException: C:\path\file.zip is not file!
Technically C:\path\file.zip is a path on server where I want to save file with desired file name. Strangely script worked ok till last few days.

I also added $session.SessionLogPath = "C:\Temp\winscp.log" but logs are also showing the same error.

Here are the logs with error appearing:
. 2022-06-06 17:08:23.444 Binary transfer mode selected.
* 2022-06-06 17:08:23.444 (ExtException) 
. 2022-06-06 17:08:23.444 Asking user:
. 2022-06-06 17:08:23.444 'C:\path\file.zip' is not file! ()
< 2022-06-06 17:08:23.444 Script: 'C:\path\file.zip' is not file!
* 2022-06-06 17:08:23.459 (ESkipFile) 'C:\path\file.zip' is not file!
. 2022-06-06 17:08:23.459 Copying finished: Transferred: 0, Elapsed: 0:00:00, CPS: 0/s
. 2022-06-06 17:08:23.459 Script: Failed
> 2022-06-06 17:08:23.475 Script: exit
. 2022-06-06 17:08:23.475 Script: Exit code: 1
. 2022-06-06 17:08:23.475 Closing connection.
. 2022-06-06 17:08:23.475 Sending special code: 12
. 2022-06-06 17:08:23.475 Sent EOF message
I tried to run new WinSCP version 5.19.6 and 5.15.9 and error is appearing for both versions. Can you please point me out how to approach with further troubleshooting?

Thanks!

Regards,
Nikola

Reply with quote

Advertisement

stijacicn
Joined:
Posts:
5
Location:
sweden

Re: WinSCP.SessionRemoteException: C:\path\file.zip is not file!

Hello Martin,
Thanks for the quick reply! I have attached the private file, also in logs I had to "mask" some sensitive information, like: IP, fingerprint, etc... so it don`t leak out by some mistake. Hope that you will understand. :)

Thanks in advance!
Regards,
Nikola
  • winscp.log (20.48 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
37,576
Location:
Prague, Czechia

Re: WinSCP.SessionRemoteException: C:\path\file.zip is not file!

After re-reading your original post: Do I understand right that it is actually true that C:\path\file.zip is not a file?
If that's the case, and you are using Session.GetFiles, make sure the target path is C:\path\file.zip\*.
See https://winscp.net/eng/docs/library_session_getfiles#remotepath
Or use Session.GetFileToDirectory instead.

If the C:\path\file.zip is a file, please post an output of
dir C:\path\file.zip

Reply with quote

Advertisement

You can post new topics in this forum