Topic "Downloading long file name files"

Author Message
JustAsking
[View user's profile]

Joined: 2017-01-09
Posts: 13
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.
Advertisements
JustAsking
[View user's profile]

Joined: 2017-01-09
Posts: 13
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
JustAsking
[View user's profile]

Joined: 2017-01-09
Posts: 13
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... Embarassed
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
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.
JustAsking
[View user's profile]

Joined: 2017-01-09
Posts: 13
[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

Description: (none)

martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
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?
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.
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Please attach a log file from GUI showing an upload of file c:\PayConcierge\InProcessPC\CX1609271430050108.999.
_________________
Martin Prikryl
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.
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License