Reputation: 141
copy(ftp://[email protected]/videodrive/video_input/Philly/Council Rock South High Schoolers hold mock presidential debate.mp4): failed to open stream: FTP server reports STOR, file: /var/www/html/user-controller.php, line: 138
The file transfers successfully my own network. But it does not work on clients network.
Upvotes: 2
Views: 1152
Reputation: 202088
The error message is nonsense, clearly a bug in PHP code.
I have reported this:
Bug #73457 Wrong error message when fopen FTP wrapped fails to open data connection.
Anyway, the root cause is most probably that an FTP data connection cannot be opened.
Most typical cause of the problem is that PHP defaults to the active mode. And in 99% cases, one has to switch to the passive mode, to make the transfer working. Use the ftp_pasv
function.
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// turn passive mode on
ftp_pasv($conn_id, true);
See also:
Upvotes: 3
Reputation: 187
Please check FTP user authentication and user permission, and check allow particular user uploading file size and your network configuration(NAT/firewall).
Upvotes: -1