FTP problem

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
BIX
Posts: 33
Joined: Fri Oct 27, 2006 2:54 pm

FTP problem

Post by BIX » Fri Dec 07, 2007 4:21 pm

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?
BIX

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Fri Dec 07, 2007 7:11 pm

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?

BIX
Posts: 33
Joined: Fri Oct 27, 2006 2:54 pm

Post by BIX » Fri Dec 07, 2007 7:54 pm

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.
BIX

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Dec 07, 2007 10:54 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

BIX
Posts: 33
Joined: Fri Oct 27, 2006 2:54 pm

Post by BIX » Fri Dec 07, 2007 11:16 pm

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
BIX

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri Dec 07, 2007 11:27 pm

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Post by Janschenkel » Mon Dec 10, 2007 1:32 pm

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

BIX
Posts: 33
Joined: Fri Oct 27, 2006 2:54 pm

Post by BIX » Sun Dec 16, 2007 1:38 pm

thank you
BIX

Post Reply

Return to “Internet”