Re: Copy Non-Text file from One Server to Another Issues
| From: | Daniel Brown | Date: | Thu, 12 Mar 2009 18:55:52 +0000 |
| Subject: | Re: Copy Non-Text file from One Server to Another Issues | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289937@lists.php.net to get a copy of this message | ||
On Thu, Mar 12, 2009 at 14:51, Alice Wei <ajwei@alumni.iu.edu> wrote:
>
> Warning: file_get_contents() expects parameter 1 to be string, resource
> given in C:\Inetpub\wwwroot\test\hello.php on line
> 18
Freshman mistake.
$file2 = fopen($copydir . "/play.txt", "w+");
You're trying to read a data stream in file_get_contents() that
was opened with fopen(). Don't.
Instead, replace the line of code above with:
$file2 = $copydir.'/play.txt';
.... and then RTFM on how to use file_get_contents().
--
</Daniel P. Brown>
daniel.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000