Re: copy problem with HTTP wrapper
| From: | David Grant | Date: | Fri, 27 Jan 2006 13:55:59 +0000 |
| Subject: | Re: copy problem with HTTP wrapper | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-229367@lists.php.net to get a copy of this message | ||
Laurent,
Laurent Vanstaen wrote:
>> If so, what makes you think it's writable in the first place?
>
> 'Cause I work for this ISP ....
So you don't have specs then I guess, since you're asking in a public
forum! Have you considered using a HTTP PUT request (using cURL)?
php.net/curl
$curl = curl_init();
$file = "replacementfile.txt";
curl_setopt($curl, CURLOPT_URL, 'http://192.168.1.1/cgi-bin/newCrontab');
curl_setopt($curl, CURLOPT_PUT, true);
curl_setopt($curl, CURLOPT_INFILESIZE, filesize($file));
curl_setopt($curl, CURLOPT_INFILE, fopen($file, 'r'));
curl_exec($curl);
Note: you might need to set the CURLOPT_USERPWD option too.
This is my best guess at a solution, but obviously I've not tested it.
David
--
David Grant
http://www.grant.org.uk/
http://pear.php.net/package/File_Ogg 0.2.1
http://pear.php.net/package/File_XSPF 0.1.0