RE: Copy Function Errors

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

 



On Wed, 2008-07-16 at 16:45 -0400, Wei, Alice J. wrote:
> > Hi,
> >
> > I have a snippet of code here:
> >
> > shell_exec("tar cvf /var/www/html/test/$id/data.tar /var/www/html/test/$id/data");
> >
> > $file1="http:/www.mysite.com/test/$id/data.tar";
> > $file2="http://www.mysite2.com/test/$id/.tar";;
> >
> > copy($file1,$file2);
> >
> > I got the following error in the access log of the server:
> >
> > [Wed Jul 16 15:45:57 2008] [error] PHP Warning:  copy(http://www.mysite.com/test/145/data.tar) [<a href='function.copy'>function.copy</a>]: failed to open stream: HTTP wrapper does not support writeable connections. in /var/www/html/beam_calculation.php on line 20
> >
> > Is there something I could do here to allow my file be "copied" to the remote server?
> 
> Use the ftp functions.
> 
> Thanks for the tip. I have revised my code to:
> 
> // define some variables
> $local_file = "C:/Inetpub/wwwroot/test/$id/beamdata.tar";
> $server_file = "http://192.168.10.63/test/$id/beamdata.tar";;
> 
> // set up basic connection
> $ftp_server="http://192.168.10.63";;

Shouldn't that be:

    $ftp_server="192.168.10.63";

http:// indicates a protocol and I don't think ftp supports the protocol
prefix understood by browsers.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
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