where and why PHP copy() fails?
Posted: Thu Jul 10, 2008 10:09 am
Hi, iam new to php. please tell me the basic reasons why PHP copy() function fails?
In my application users upload a file and all the uploaded files are copied to one stage folder by giving them randomly created number as file name.
my Sample code is given below.
$tp = substr(md5(uniqid(rand(), true)),0, 10);
if(! copy($_FILES['f']['tmp_name'], "./directory/{$tp}"))
die_log("unable to copy.");
please tell me the reasons why this copy() fails? thanks in advance.
Thanks,
krishna.p
In my application users upload a file and all the uploaded files are copied to one stage folder by giving them randomly created number as file name.
my Sample code is given below.
$tp = substr(md5(uniqid(rand(), true)),0, 10);
if(! copy($_FILES['f']['tmp_name'], "./directory/{$tp}"))
die_log("unable to copy.");
please tell me the reasons why this copy() fails? thanks in advance.
Thanks,
krishna.p