|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2015-01-21 23:36 UTC] cmbecker69 at gmx dot de
[2015-01-22 07:32 UTC] ian dot gooch at weatherquest dot co dot uk
[2021-03-04 11:25 UTC] cmb@php.net
-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: cmb
[2021-03-04 11:25 UTC] cmb@php.net
[2021-03-14 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
Description: ------------ I've tried and tried to ftp_put over a secured connection. Errors returned are ftp_put(): Opening BINARY mode data connection. Type set to I I've tried to things like ftp_pasv, but no joy. I know the connection work because Dreamweaver connects are uploads fine. Thanks, Test script: --------------- //FTP FILE $FTPServer="******"; $Port=21; $User="******"; $Pass="******"; echo "$FTPServer | $Port | $User | $Pass <br>"; //=================================================== $DEST="******"; $NAME="SomeFile.csv"; $DESP="$DEST$NAME"; //====================================================== //SET UP CONNECTION $FTPCon = ftp_ssl_connect($FTPServer,$Port) or die("Cannot connect to server!"); $LOGINR = ftp_login($FTPCon,$User,$Pass) or die("Cannot login!"); //ftp_pasv($FTPCon,true); ftp_set_option($FTPCon, FTP_TIMEOUT_SEC, 10); //-------------------------------------------------------------------- //CHECK CONNECTION if ((!$FTPCon) || (!$LOGINR)) { echo "FTP connection has failed!"; exit; }else{ echo "Connected to $FTPServer,$Port, for user $User <br/>"; //CHANGE DIR echo "Current directory: " . ftp_pwd($FTPCon) . "\n"; echo "<br>"; //==================================================== if (ftp_chdir($FTPCon, "*******")) { echo "Current directory is now: " . ftp_pwd($FTPCon) . "<br>"; }else{ echo "Couldn't change directory <br>"; echo "<br>"; //================================================== } //UPLOAD FILE $UPLoad = ftp_put($FTPCon,$NAME,$csvOut,FTP_BINARY); if (!$UPLoad) { echo "FTP upload of $NAME has failed! <br/>"; }else{ echo "Uploading $name Completed"; } } ftp_close($FTPCon); echo "Bye Bye you"; //--------------------------------------------------------------------- Expected result: ---------------- The file uploads (ftp) to a secured server