Downloading long file name files

Advertisement

JustAsking
Joined:
Posts:
14

Downloading long file name files

I know that there is some sort of issue with WinSCP downloading long file names from within Powershell as I have seen a number of reports on this. I am using the latest version. The typical error I get is:

Failures : {WinSCP.SessionRemoteException: Can't create file 'c:\Directory\InProcessPC\AB1701090015040110.999'.
System Error. Code: 3.
The system cannot find the path specified}

BUT I can sometimes get this to work.

The following works to pull down the very same sets of files that fail to come down under more complex situations (generating the above error):

$session.GetFiles( $filemaskDown, $localPath, $false ).Check( )

Well it appears to work some/most times. It seems to work until it doesn't?!?! It is like my Powerscript code gets to a level of complexity and BAM starts generating those errors. I am using Powerscript 4 (Win7) and 5 (Win10). Anybody got any ideas?

Is it the name of the file that is the issue or the individual path components? What is the "limiting" issue? I could always temporally rename each server file shorter, download it and then name it back to what it initially was named, correct? Would that get around the issue?

Thoughts? Thanks.

Reply with quote

Advertisement

JustAsking
Joined:
Posts:
14

Continued...

OK, just tried renaming the file to a 8.3 length, and then downloading and same issue.

Failures : {WinSCP.SessionRemoteException: Can't create file 'c:\TmpDirectory\InProcessPC\working.txt'.
System Error. Code: 3.
The system cannot find the path specified}
IsSuccess : False

Reply with quote

JustAsking
Joined:
Posts:
14

OK, worked around...

Not pretty but managed to code a work-around.

I get a listing of the files on the remote server and one by one:
- I rename each file to a short-name
- download the file to a short directory
- rename the file back (in production the file will be removed but for testing, this is easier)
- move-item the file to its final resting place while renaming it back to its original name (from the server)

It works but... :oops:

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Downloading long file name files

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

JustAsking
Joined:
Posts:
14

Re: Downloading long file name files

[quote="martin"]Please attach a full session log file showing the problem (using the latest version of WinSCP).

Here you go...
  • winscplog.txt (15.83 KB, Private file)

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Downloading long file name files

Does the local path c:\PayConcierge\InProcessPC exists? Can you browse to it in WinSCP GUI? Can you download the files to that folder in WinSCP GUI? What is a local file system of the path?

Reply with quote

Guest

Yes to all. I can see the directory structure in WINSCP GUI and I can transfer those exact files without error. I performed the manual transfers as binary and as ASCII.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Please attach a log file from GUI showing an upload of file c:\PayConcierge\InProcessPC\CX1609271430050108.999.
_________________
Martin Prikryl

Reply with quote

Guest

Wait...

I may have found a Powershell script "bug" that was causing this issue. Am still investigating and will post my results either way.

Reply with quote

Advertisement

You can post new topics in this forum