Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
[function.copy]: failed to open stream: No such file or directory
Old 02-16-2009, 02:38 PM [function.copy]: failed to open stream: No such file or directory
Junior Talker

Posts: 1
Trades: 0
"copy.php" script want to copy all files(url in "url.txt" file) to this server, but return "error"!
Please help me.
note: i use copy function for copy file from another server (single file) in other script without any problem.

copy.php content:
Code:
<?php
$handle = @fopen("url.txt", "r");
if ($handle)
	{
    while (!feof($handle))
	    {
        $buffer = fgets($handle, 4096);
		$filename=basename($buffer);
		copy($buffer,$filename);
		}
    fclose($handle);
	}
?>
url.txt content:
Code:
http://googlea4.com/download/software/internet/Yahoo!_Messenger_Vista_10/GoogleA4.com_Yahoo!_Messenger_Vista_interface.jpg
http://www.googlea4.com/GoogleA4.com_Portable_Google_Chrome_2.0.156.1.rar
www.googlea4.com/mehr4/magazine/mehr4-booltan5-web.pdf
sefidshahr.googlea4.com/yadegari/Y1.pdf
Error:
Code:
Warning: copy(www.googlea4.com/mehr4/magazine/mehr4-booltan5-web.pdf ) [function.copy]: failed to open stream: No such file or directory in /home/fhlinux193/b/domain.com/user/htdocs/copy.php on line 9

Warning: copy(sefidshahr.googlea4.com/yadegari/Y1.pdf ) [function.copy]: failed to open stream: No such file or directory in /home/fhlinux193/b/domain.com/user/htdocs/copy.php on line 9

Warning: copy( ) [function.copy]: failed to open stream: No such file or directory in /home/fhlinux193/b/domain.com/user/htdocs/copy.php on line 9
_______________________________________________
ghasembaghi2 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-16-2009, 04:34 PM Re: [function.copy]: failed to open stream: No such file or directory
Insensus's Avatar
Ultra Talker

Posts: 487
Name: Mark Stegeman
Location: Netherlands, Europe
Trades: 0
I suggest you add http://www. to the last two lines in url.txt
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>

Last edited by Insensus; 02-17-2009 at 02:57 PM..
Insensus is offline
Reply With Quote
View Public Profile
 
Old 02-16-2009, 05:16 PM Re: [function.copy]: failed to open stream: No such file or directory
jason_alan's Avatar
Super Talker

Posts: 100
Name: Jason
Location: Seattle, WA
Trades: 0
Try using the full path to the file. If it is in the same directory as your script then you could do:
PHP Code:
$filename dirname(__FILE__) . '/copy.txt';
$handle = @fopen($filename"r"); 
jason_alan is offline
Reply With Quote
View Public Profile
 
Old 02-17-2009, 02:35 PM Re: [function.copy]: failed to open stream: No such file or directory
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
If I recall correctly, copy() only works for internal files.
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Old 02-18-2009, 02:07 PM Re: [function.copy]: failed to open stream: No such file or directory
Novice Talker

Posts: 14
Name: Andy
Trades: 0
also make sure that you have permission to the directory.
__________________
TextLinksDepot.com -
Please login or register to view this content. Registration is FREE
andylaubobby is offline
Reply With Quote
View Public Profile Visit andylaubobby's homepage!
 
Old 02-19-2009, 02:55 AM Re: [function.copy]: failed to open stream: No such file or directory
Novice Talker

Posts: 11
Trades: 0
fopen for url might be off on your server.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
tailender1 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to [function.copy]: failed to open stream: No such file or directory
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.53235 seconds with 12 queries