Page 1 of 1

fwrite to FTP

Posted: Sun Apr 17, 2005 12:29 pm
by Vladinator
My problem is that when I run the script...

Code: Select all

$file = fopen(&quote;ftp://username:password@swede-wow.kicks-ass.org/somefile.txt&quote;,&quote;w&quote;); 
fwrite ($file, $text); 
fclose ($file);
... I get the error...

Code: Select all

fopen(): URL file-access is disabled in the server configuration
I tried to add this line, in the php script file:
ini_set('allow_url_fopen', 1);

...But the same error, still comes. Any ideas? :?

Posted: Sun Apr 17, 2005 12:57 pm
by feyd
Please read the posting code guidelines linked to in all posting pages and in my signature.

allow_url_fopen is a system level setting. That means it can only be changed in httpd.conf or php.ini.

Posted: Sun Apr 17, 2005 12:58 pm
by shiznatix
use php to connect to the ftp instead of the url.
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);