php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40884 Cannot specify port range in pasv mode
Submitted: 2007-03-21 17:12 UTC Modified: 2016-12-31 00:02 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: simon at connexon dot com Assigned:
Status: Open Package: FTP related
PHP Version: 5.2.1 OS: Windows Server 2003
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
12 + 25 = ?
Subscribe to this entry?

 
 [2007-03-21 17:12 UTC] simon at connexon dot com
Description:
------------
Ok, I searched everywhere for this but could not find anything... And I think it should be there. When using pasv_mode for a ftp connection, we should allowed to specify the port range that the passive mode will be using. In our case, the place where we need to upload some files accept only pasv connections with ASCII data, and a range of ports between 49000 and 50000.

So ftp_connect does connect to port 21, however there is no way to specify that the pasv_mode will be using a range of ports. So the changes of it using a port in the range is quite slim!

Any ideas?

Reproduce code:
---------------
$conn_id = ftp_connect(_FTP_SERVER_, 21, 15) or die("Could not connect to FTP");

ftp_pasv($conn_id, true);

$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_ASCII) or die("Could not upload the desired file.");

Expected result:
----------------
The file being uploaded

Actual result:
--------------
Well since it's not using a valid port, it fails.
But I guess it's normal since we can't specify a port range!

Can this be integrated in PHP?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:02 UTC] cmb@php.net
-Package: Feature/Change Request +Package: FTP related
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 22:04:50 2022 UTC