Page 1 of 1

FTP problem

Posted: Fri Dec 07, 2007 4:21 pm
by BIX
When i connect to ftp server with rev stack or standalone, every line of any message that it receive from the server ends with some weird box. I wanted to post it here but it can't be copied.
What can be the problem?

Posted: Fri Dec 07, 2007 7:11 pm
by malte
line endings.

for the resulting messages:

put cr is in the message

put lf is in the message

put crlf is in the message

What kind of operating system are you on?

Posted: Fri Dec 07, 2007 7:54 pm
by BIX
OK, i will be more specific.

Here is the simple script:

Code: Select all

on mouseUp
  open socket "localhost:21"
  read from socket "localhost:21" with message gotData
end mouseUp

on gotData som,dat
  put dat & cr after fld "someFld"
  read from socket "localhost:21" with message gotData
end gotData
So, this works. But every line that is received from FTP server (i tried many of them) ends with box.

I use Win Xp SP2. On Vista I didn't have these problems.

Posted: Fri Dec 07, 2007 10:54 pm
by Mark
Hi BIX,

This won't work, unless you have a desire to figure out the FTP protocol yourself. Search for "ftp" in the docs and you will find 6 or 7 useful commands and functions.

Best,

Mark

Posted: Fri Dec 07, 2007 11:16 pm
by BIX
This actually "works", it receives messages from server, like welcome message and other, but with that weird box.

When I use script:

Code: Select all

answer url "ftp://localhost/"
it answers the list of files on the server, but, i repeat, with some box at the end of each line.

Image

Posted: Fri Dec 07, 2007 11:27 pm
by Mark
BIX,

As malte explained, this is probably due to line endings. Try this:

put url "ftp://localhost/" into myList
put chartonum(-2) of myList & cr & chartonum(-1) of myList

What do you get?

Mark

Posted: Mon Dec 10, 2007 1:32 pm
by Janschenkel
Or you can replace the extra carriage returns like this:

Code: Select all

put URL "ftp://localhost/" into theList
replace CRLF with LF in theList
answer theList
Hope this helped,

Jan Schenkel.

Posted: Sun Dec 16, 2007 1:38 pm
by BIX
thank you