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

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

 





> Date: Thu, 12 Mar 2009 14:55:52 -0400
> Subject: Re:  Copy Non-Text file from One Server to Another Issues
> From: danbrown@xxxxxxx
> To: ajwei@xxxxxxxxxxxxx
> CC: php-general@xxxxxxxxxxxxx
> 
> 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

Hi, Daniel:
  
   Thanks, it turned out that other than using your suggestion, it turned out that using copy() works great. 
   However, is it possible for me not to use the actual physical url as I have provided in my code to access the information I intend to copy? 
   My goal is to be able to search through the remote directory, and find the matched files of a certain format and copy it to another server. 

Is this possible?

Alice

_________________________________________________________________
Check the weather nationwide with MSN Search: Try it now!
http://search.msn.com/results.aspx?q=weather&FORM=WLMTAG

[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