Re: Copy Non-Text file from One Server to Another Issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 12, 2009 at 14:51, Alice Wei <ajwei@xxxxxxxxxxxxx> 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@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux