symlinks instead of files

Advertisement

mshifu
Joined:
Posts:
3

symlinks instead of files

I normally use lftp or filezila in my linux system to download files from the securities and exchange commission ftp website (ftp.sec.gov).

A few days ago I began trying to do the same thing using an ftp client on windows. However, I have had problems doing so. It seems that the native client that comes with windows cannot get access to data and refuses the connection (although it allows me to connect to the server). This may have to do with lack of passive mode...but I am not sure. Then I found this application and everything was going well navigating the sec ftp site until I decided to download a file. Winscp believes these files are symlinks and thus nothing happens when I try to download. I use ncftp and I had no problem downloading a single file. What is nice about Winscp is that if I solve this issue I can script a batch process to download many files. Something that seems to be a limitation in all windows ftp clients that I have looked at.

The problem is replicable by running the following lines (no password). You can also connect using the GUI, however consider that the folder data is not browsable so you have to leapfrog onto the 1062195 folder to get the listing:
open ftp://anonymous@ftp.sec.gov
get /edgar/data/1062195/0001104659-06-016816.txt

winscp believes that the file 0001104659-06-016816.txt is the symlink.

I have been all day on this. If someone could help me, I would appreciate the assistance very much.

Reply with quote

Advertisement

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

Re: symlinks instead of files

Please attach a full log file showing the problem.

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. 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 may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

Reply with quote

martin
Site Admin
martin avatar

Re: symlinks instead of files

It looks like the files are indeed presented as symlinks by your server. Please post Debug 1-level log files to make sure.

Reply with quote

mshifu
Joined:
Posts:
3

Re: symlinks instead of files

In reviewing the log detail you asked for, I can see that indeed these seem to be links. If that is the case, what is the work around? How is it possible that only winscp can see the files for what they are? all other ftp software I have tried views them as files and allow me to download the actual file at the end of the link.

Thank you!

Reply with quote

Advertisement

RobHam
Joined:
Posts:
15
Location:
Wales, UK

Re: symlinks instead of files

mshifu wrote:

In reviewing the log detail you asked for, I can see that indeed these seem to be links. If that is the case, what is the work around? How is it possible that only winscp can see the files for what they are? all other ftp software I have tried views them as files and allow me to download the actual file at the end of the link.

Thank you!

I tried to download your file using wsftp client - latest version - and it also will not download the file using the path to the server symlink. Log posted below.

Appears that your server is returning "550 /edgar/data/1062195/0001104659-06-016816.txt: No such file or directory"

Finding Host ftp.sec.gov ...
Connecting to 162.138.185.31:21
Connected to 162.138.185.31:21 in 0.000000 seconds, Waiting for Server Response
220 FTP server ready.
Host type (1): AUTO
USER anonymous
331 Anonymous login ok, send your complete email address as your password
PASS (hidden)
230-Anonymous access granted, restrictions apply

Please read the file README.txt
230 it was last modified on Tue Aug 15 14:29:31 2000 - 4360 days ago
SYST
215 UNIX Type: L8
Host type (2): Unix (Standard)
PWD
257 "/" is the current directory
/ loaded from [Directory Listing Cache]DIR91.tmp
CWD edgar
250-CWD command successful
Please read the file README.txt
250 it was last modified on Tue Jul 10 10:40:51 2007 - 1841 days ago
CWD data
250 CWD command successful
CWD 1062195
250 CWD command successful
CWD 0001104659-06-016816.txt
550 0001104659-06-016816.txt: No such file or directory
XCWD 0001104659-06-016816.txt
550 0001104659-06-016816.txt: No such file or directory
CWD /edgar/data/1062195/0001104659-06-016816.txt
550 /edgar/data/1062195/0001104659-06-016816.txt: No such file or directory
XCWD /edgar/data/1062195/0001104659-06-016816.txt
550 /edgar/data/1062195/0001104659-06-016816.txt: No such file or directory
PWD
257 "/edgar/1998/fix2/1062195" is the current directory
QUIT
221 Goodbye.
Connection closed. Ready for next connection.

Reply with quote

RobHam
Joined:
Posts:
15
Location:
Wales, UK

Re: symlinks instead of files

mshifu wrote:

In reviewing the log detail you asked for, I can see that indeed these seem to be links. If that is the case, what is the work around? How is it possible that only winscp can see the files for what they are? all other ftp software I have tried views them as files and allow me to download the actual file at the end of the link.

Thank you!

Your file does download when using filezilla as a client.

The sequence for successful down load is :-

1. Change server to the correct working directory
CWD /edgar/data/1062195

2. Then request the working directory back from the server using
PWD
The actual working directory returned using this command may be different because of a symlink in the directory tree, hence the client needs to changes to this directory if it is different.

3. Then retrieve the file using the standard list of FTP commands - TYPE A PASV RETR etc.


A previous log posted seems to infer that WinSCP does send the PWD command, hence unsure why WinSCP has issues downloading the file, the log files seem reasonably similar but slightly different where the file should be downloaded. Perhaps the Filezilla log below may help with this issue.


2012-07-24 19:11:44 460 1 Status: Connected
2012-07-24 19:11:44 460 1 Status: Starting download of /edgar/data/1062195/0001104659-06-016816.txt
2012-07-24 19:11:44 460 1 Command: CWD /edgar/data/1062195
2012-07-24 19:11:45 460 1 Response: 250 CWD command successful
2012-07-24 19:11:45 460 1 Command: PWD
2012-07-24 19:11:45 460 1 Response: 257 "/edgar/1998/fix2/1062195" is the current directory
2012-07-24 19:11:45 460 1 Status: Retrieving directory listing...
2012-07-24 19:11:45 460 1 Command: TYPE I
2012-07-24 19:11:45 460 1 Response: 200 Type set to I
2012-07-24 19:11:45 460 1 Command: PASV
2012-07-24 19:11:45 460 1 Response: 227 Entering Passive Mode (162,138,185,32,138,45).
2012-07-24 19:11:45 460 1 Command: MLSD
2012-07-24 19:11:45 460 1 Response: 150 Opening ASCII mode data connection for MLSD
2012-07-24 19:11:54 460 1 Response: 226 Transfer complete
2012-07-24 19:11:54 460 1 Command: TYPE A
2012-07-24 19:11:54 460 1 Response: 200 Type set to A
2012-07-24 19:11:54 460 1 Command: PASV
2012-07-24 19:11:54 460 1 Response: 227 Entering Passive Mode (162,138,185,32,217,181).
2012-07-24 19:11:54 460 1 Command: RETR 0001104659-06-016816.txt
2012-07-24 19:11:55 460 1 Response: 150 Opening ASCII mode data connection for 0001104659-06-016816.txt (3203952 bytes)
2012-07-24 19:12:46 460 1 Response: 226 Transfer complete
2012-07-24 19:12:46 460 1 Status: File transfer successful, transferred 3,247,495 bytes in 52 seconds

Reply with quote

Advertisement

You can post new topics in this forum