TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   rename problem (http://www.talkphp.com/absolute-beginners/5648-rename-problem.html)

medvirus 11-28-2010 03:14 PM

rename problem
 
hi friend in php why cant rename file across drive
like this
suppose :
PHP Code:

$c="";
$d="";
$re=rename($c,$d);
if(
$re)
{echo 
"Success";}
else{
echo 
"Failed";} 

Now if i put
$c="F:\/1.jpg";
ANd
$d="F:\/2.jpg";
it show me success

But if i Change Drive then Not work
like
$c="F:\/1.jpg";
ANd
$d="E:\/2.jpg";
then Failedd

So Hope some will Solve my problem or give me a good Solution...:'-(

Village Idiot 11-28-2010 06:51 PM

Does it give a more specific reason for failure? If I had to guess I'd say its a permissions error, make sure the user that runs PHP had access to both hard drives.

medvirus 12-01-2010 09:17 AM

this error i got
Warning: rename(C:\/1.amr,D:\/1.amr) [function.rename]: No error in C:\wamp\www\prev0~.php on line 4
Failed
PHP Warning: rename(C:\/1.amr,D:\/1.amr) [function.rename]: No error in C:\wamp\www\prev0~.php on line 4


All times are GMT. The time now is 12:39 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0