List Info

Thread: note 78073 added to function.ftp-pasv




note 78073 added to function.ftp-pasv
user name
2007-09-26 19:36:19
When you're trying to activate passive mode using the ftp
raw command PASV, you can process the reply using the
following regular expression:

<?php

$rule =
'/^[0-9]+s.*(([0-9,]+),([0-9]+),([0-9]+)).*$/im';

    // $ftp_server_reply is considered the reply provided
    // by the FTP server.
    if (preg_match($rule, $ftp_server_reply, $m)) {

        $passive_host = str_replace(',', '.', $m[1]);
        $passive_port = $m[2]*256+$m[3];
    }
?>

Then you can open a stream where you can send the file you
want to upload, or the data you want to operate.

This post over here explains how things work with the FTP
passive mode, in a friendly way: http://tinyurl.com/2bwuqs

Cheers, 
Vladimir

http://www.TopNotchCoder
.com

P.S. Passive mode means opening a new connection where data
is being sent when uploading files, that's why it has to be
initiated after login, considering the logical order of
actions: Login -> CWD -> upload stuff.
----
Server IP: 69.147.83.197
Probable Submitter: 89.101.121.46
----
Manual Page -- ht
tp://www.php.net/manual/en/function.ftp-pasv.php
Edit        -- https://master
.php.net/note/edit/78073
Del: integrated  -- h
ttps://master.php.net/note/delete/78073/integrated
Del: useless     -- http
s://master.php.net/note/delete/78073/useless
Del: bad code    -- htt
ps://master.php.net/note/delete/78073/bad+code
Del: spam        -- https:/
/master.php.net/note/delete/78073/spam
Del: non-english -- 
https://master.php.net/note/delete/78073/non-english
Del: in docs     -- http
s://master.php.net/note/delete/78073/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78073
Reject      -- https://mast
er.php.net/note/reject/78073
Search      -- https://
master.php.net/manage/user-notes.php

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


note 78073 deleted from function.ftp-pasv by nlopess
user name
2007-09-27 17:42:28
Note Submitter: vladimir at pixeltomorrow dot com 

----

When you're trying to activate passive mode using the ftp
raw command PASV, you can process the reply using the
following regular expression:

<?php

$rule =
'/^[0-9]+s.*(([0-9,]+),([0-9]+),([0-9]+)).*$/im';

    // $ftp_server_reply is considered the reply provided
    // by the FTP server.
    if (preg_match($rule, $ftp_server_reply, $m)) {

        $passive_host = str_replace(',', '.', $m[1]);
        $passive_port = $m[2]*256+$m[3];
    }
?>

Then you can open a stream where you can send the file you
want to upload, or the data you want to operate.

This post over here explains how things work with the FTP
passive mode, in a friendly way: http://tinyurl.com/2bwuqs

Cheers, 
Vladimir

http://www.TopNotchCoder
.com

P.S. Passive mode means opening a new connection where data
is being sent when uploading files, that's why it has to be
initiated after login, considering the logical order of
actions: Login -> CWD -> upload stuff.

-- 
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )