Re: copy problem with HTTP wrapper

From: Date: Fri, 27 Jan 2006 07:59:31 +0000
Subject: Re: copy problem with HTTP wrapper
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-229357@lists.php.net to get a copy of this message
Hi all, I'm trying to copy a file from my PHP server to another server (a home gateway, called a LiveBox). I've used this code : $livebox = "192.168.1.1"; ... ... ... $crontab_livebox = "http://".$livebox."/cgi-bin/newCrontab"; if (!copy($crontab_temp_name, $crontab_livebox)) { echo "<br />Impossible to copy the temp crontab file to the Livebox.<br />"; } I get the following error : "HTTP wrapper does not support writeable connections" OK can I solve this. Can't I use URLs with the "copy" function if they don't point to my PHP server (local URLs) ? How can I copy a file from my PHP server to another server (there's no FTP server on the destination machine) ? Put it this way: If what you typed above *DID* work, what's to stop *ME* from copying whatever I want onto your server?...
I see your point. Here in my case the server I want to copy a file on has 192.168.1.1 for IP address and thus cannot be found from outside a LAN, so the security problem is not that much important. But I agree with you and see what you mean.
You probably need to use cURL to login to your livebox, and then POST the data into the newCrontab form handler.
OK I'm gonna look for information about that. Thank you, Laurent

« previous php.general (#229357) next »