|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-03-21 17:12 UTC] simon at connexon dot com
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?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:02 UTC]
-Package: Feature/Change Request +Package: FTP related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jun 16 05:01:29 2024 UTC