JMR JMR - 6 months ago 15
PHP Question

php-how to move files to the folder created using userid (upload files)

Once the is uploaded i am creating folder based on Application id which is unique.

The problem i am facing here is, once i upload ,files are uploade out side respected folders.

even folder is getting created.

Can any any one help on this!!!

$path = $file['name'];
$path_user = '/home/devestctrl/public_html/wp-content/plugins/est_collaboration/Files/'.'/'.$send_id;
if (!file_exists($path_user)) {
if (mkdir( $path_user,0766,false )) {
if (move_uploaded_file($file['tmp_name'],$path_user.$path)) {
echo"inside 2"."<br>";
echo"Your File Successfully Uploaded";
}
}
}

Answer

Remove extra / between est_collaboration/Files/' And .$send_id.

Append / in last. Like

$path_user = '/home/devestctrl/public_html/wp-content/plugins/est_collaboration/Files/'.$send_id.'/';

Comments