r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Rebol School] Rebol School

btiffin
13-Feb-2008
[696]
Compressed at http://www.rebol.net/rs/server.rand client.r  with 
the standard  save ... ctx-services thingy.

I'm pretty sure this is Gabriele's later release that has support 
for large file transfers.

I would say yes, LNS is still a good plan.  It's in use with DevBase.
Vladimir
13-Feb-2008
[697]
Ahaaa..... so it was only matter of path..... http://www.rebol.net/rs
instead of http://www.rebol.net/rebservices..... :)
Thanks!
Vladimir
28-Mar-2008
[698x2]
Here is one question for you guys:
I want to upload file on ftp. 
I know I can do it like this:
write/binary ftp://user:[pass-:-website-:-com] read/binary %file

Or I am supossed to do it.... it just wont let me....


>>  write/binary ftp://user:[pass-:-ftp-:-site-:-com] read/binary %file.txt
** User Error: Cannot open a dir port in direct mode

** Near: write/binary ftp://user:[pass-:-ftp-:-site-:-com] read/binary %file.txt

I can read the contents of ftp rootdir with:
print read ftp://ftp.site.com/


But writing is not working.... What does it mean: "Cannot open a 
dir port in direct mode"?
BrianH
28-Mar-2008
[700]
Try this:  write/binary ftp://user:[pass-:-ftp-:-site-:-com]/file.txt read/binary 
%file.txt
Yoiu were trying to write to a directory, not a file.
Vladimir
29-Mar-2008
[701]
Thanks Brian !!!! I just didnt see it yesterday evening.... :)
Gregg
30-Mar-2008
[702]
Another common issue with FTP is to set  system/schemes/ftp/passive 
to true.
Vladimir
31-Mar-2008
[703x2]
I looked at available documentation, and can not find any advanced 
settings like that in there.....
Where can I find info like that ?
p.s. But I can always ask you guys :)
Ufffff......... I just found it in reb23 core documentation chapter 
11.... :) 
That's what you get when you rely on google... :)
Vladimir
29-Oct-2008
[705x3]
Ftp problem again.... everything was working perfectly from march 
till now.... we changed internet provider yesterday and my scripts 
dont work any more :(
Here is the core of script where error is:

server: ftp://user:[pass-:-ftp-:-firm-:-com]/data
file: %file.zip
from-port: open/binary/direct lokal/:file
to-port: open/binary/new/direct server/:file

** Access Error: Network timeout
** Where: confirm
** Near: to-port: open/binary/new/direct server/:file
I can still connect with ftp applications....
Should I check ports and wich ones?
Anton
29-Oct-2008
[708]
You can get more detail by doing this first:
	trace/net on
Rebol will print more information in the console.

At a deeper level, you can use Wireshark (open source program) to 
capture and analyse the ftp traffic.
DideC
29-Oct-2008
[709]
Make sure the username does not contain any "@". It's often a problem, 
but may bring another kind of error.
Vladimir
30-Oct-2008
[710x3]
Trace/net  did gave more info:

Its not my new internet provider... :)  its our old router used in 
a new way... :)
This is the message I get...
Username... pass.... OK.... and then:
Net-log: "Opening listen port 2655"
Net-log: [["PORT" port/locals/active-check] "200"]
Net-log: "200 PORT command successful"
Net-log: [["CWD" port/path] ["25" "200"]]
Net-log: "250 OK. Current directory is /apl"
Net-log: "Type: new"
Net-log: ["TYPE I" "200"]
Net-log: "200 TYPE is now 8-bit binary"
Net-log: [["STOR" port/target] ["150" "125"]]
Net-log: "Closing cmd port 2652 21"
Net-log: "Closing listen port 2655"
** Access Error: Network timeout
** Where: confirm
** Near: to-port: open/binary/new/direct server/:file
On what port should I focus?
It seams standard 20 and 21 are going thru....
I noticed UDP disabled in my router configuration... could it have 
something to do with my problem?
Graham
30-Oct-2008
[713]
can you try this ?
system/schemes/ftp/passive: true
Vladimir
30-Oct-2008
[714]
It does not help..... :(

As I wrote before... It worked without problem for half a year.... 
now I have new provider... if I connect my pc directly to WAN it 
works.... When I connect PC to my router lan port it does not.... 
Everything else works.... HTTP , FTP from Total commander... upload 
download...., torrents work....
Pekr
30-Oct-2008
[715x2]
Vladimir - what is your FTP user name? Does it contain @ char? If 
so, you need small patch. Look at how is Total commander FTP configured. 
It should work. Aren't you using proxy? You might install WireShark 
and watch packets, that is the very low level of networking,  you 
will see everything there. Then you could compare your Total Commander 
connection with your REBOL one and see, where they differ....
also - what are your directories? Simple ones? Without space? Or 
is there space in it?
Vladimir
30-Oct-2008
[717]
user name is "visaprom.com"
Total commander is set up simply...
use passive is ON...
here is what is happening with ftp/passive: true:

Net-log: "215 UNIX Type: L8"
Net-log: ["PWD" "25"]
Net-log: {257 "/" is your current location}
Net-log: ["PASV" "227"]
Net-log: "227 Entering Passive Mode (194,9,94,127,235,183)"
Net-log: [["CWD" port/path] ["25" "200"]]

this is where it pauses and then:

Net-log: "Closing cmd port 3565 21"
** Access Error: Network timeout
** Where: confirm
** Near: to-port: open/binary/new/direct server/:file
Pekr
30-Oct-2008
[718x2]
so username contains .com? Not sure it is allowed or that url parser 
handless it correctly, but I might be wrong ...
do you have any other account to try?
Anton
30-Oct-2008
[720]
He got passed the login stage - that's not the problem.
Vladimir
30-Oct-2008
[721]
just a sec...
Pekr
30-Oct-2008
[722]
ok, so port/path? What is the path you are trying to access?
Anton
30-Oct-2008
[723]
FTP runs over TCP, not UDP.
Vladimir
30-Oct-2008
[724]
as I said... it works from other connections.... only problem is 
this new one in this office.... it has to be something with router.... 
Im looking configuration pages for two days now... :(
Anton
30-Oct-2008
[725]
Does the FTP server identify itself anywhere in the log ?
Pekr
30-Oct-2008
[726]
So the same script works from other locations, right? Hmm, that is 
really weird ...
Vladimir
30-Oct-2008
[727x2]
here is script result...
to-port: open/binary/new/direct server/:file

URL Parse: visaprom.com password ftp.visaprom.com none apl/ ik104.zip
Net-log: ["Opening" "tcp" "for" "FTP"]
Net-log: [none ["220" "230"]]

Net-log: {220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------}
Net-log: "220-You are user number 188 of 400 allowed."
Net-log: "220-Local time is now 11:33. Server port: 21."
Net-log: "220-This is a private system - No anonymous login"
Net-log: {220-IPv6 connections are also welcome on this server.}

Net-log: {220 You will be disconnected after 15 minutes of inactivity.}
Net-log: [["USER" port/user] "331"]
Net-log: "331 User visaprom.com OK. Password required"
Net-log: [["PASS" port/pass] "230"]
Net-log: {230-User visaprom.com has group access to:  www     }
Net-log: "230 OK. Current restricted directory is /"
Net-log: ["SYST" "*"]
Net-log: "215 UNIX Type: L8"
Net-log: ["PWD" "25"]
Net-log: {257 "/" is your current location}
Net-log: ["PASV" "227"]
Net-log: "227 Entering Passive Mode (194,9,94,127,216,138)"
Net-log: [["CWD" port/path] ["25" "200"]]
Pekr
30-Oct-2008
[729]
Vladimir - IIRC, FTP is strange beast, and network admins don't like 
it. FTP uses port 21 to establish connection, but to transfer data, 
other port is used  - 20 IIRC.
Vladimir
30-Oct-2008
[730x4]
path is simply  one directory name....
thats what is bugging me.... ftp from windows command line works...
from commander works...
even my script works up to the point....
Pekr
30-Oct-2008
[734]
You also should be sure, that you use passive mode. So check your 
firewall, if port 20 is opened. But usually all ports going to WAN 
are opened ...
Vladimir
30-Oct-2008
[735x4]
[["CWD" port/path] ["25" "200"]]
what does it mean?
port 25?
Ill try to open port 25 ?
Pekr
30-Oct-2008
[739]
here's list from my system:

connecting to: www.jablunkovsko.cz
Net-log: [none ["220" "230"]]
Net-log: "220 (vsFTPd 1.2.1)"
Net-log: [["USER" port/user] "331"]
Net-log: "331 Please specify the password."
Net-log: [["PASS" port/pass] "230"]
Net-log: "230 Login successful."
Net-log: ["SYST" "*"]
Net-log: "215 UNIX Type: L8"
Net-log: ["PWD" "25"]
Net-log: {257 "/"}
Net-log: "Opening listen port 50061"
Net-log: [["PORT" port/locals/active-check] "200"]
Net-log: "200 PORT command successful. Consider using PASV."
Net-log: "Type: dir"
Net-log: ["TYPE A" "200"]
Net-log: "200 Switching to ASCII mode."
Net-log: ["LIST" ["150" "125"]]
Net-log: "150 Here comes the directory listing."
Net-log: "Closing listen port 50061"
Net-log: "Closing data port 193.85.151.2 50061 20"
Net-log: [none ["226" "250"]]
Net-log: "226 Directory send OK."
Net-log: "Caching cmd-port www.jablunkovsko.cz 50060 21"
Anton
30-Oct-2008
[740x2]
Check here to understand FTP return codes:
http://en.wikipedia.org/wiki/Ftp#FTP_return_codes
2xx: Positive Completion reply
  so you can see the 200 codes when things went well.
Pekr
30-Oct-2008
[742]
Vladimir: does simple one liner as print read ftp://user:[pass-:-ftp-:-domain-:-com] 
fails too?
Vladimir
30-Oct-2008
[743x2]
Ill try... in a minute
hey guys thanks for helping ! :)
Anton
30-Oct-2008
[745]
Well, it looks like the PureFTPd server likes passive mode less than 
it likes active mode.