Bob,
I am using your fantastic File Upload action on a form. The action has the ability to create folders on the server for uploads based on the logged-in user's name. I simply insert {username} into the path and it works just fine!
However, I would really like to use the logged in user's ID rather than the username. Is this possible? I tried using {id} and {userid}, but those did not work.
Thanks!!
Rick
I am using your fantastic File Upload action on a form. The action has the ability to create folders on the server for uploads based on the logged-in user's name. I simply insert {username} into the path and it works just fine!
However, I would really like to use the logged in user's ID rather than the username. Is this possible? I tried using {id} and {userid}, but those did not work.
Thanks!!
Rick
Hi Rick,
It should work if you add the user Id to the $form->data array first in a Custom Code action
Bob
It should work if you add the user Id to the $form->data array first in a Custom Code action
<?php
$user =& JFactory::getUser();
$form->data['user_id'] = $user->id;
?>
then use {user_id} in the folder path.Bob
This topic is locked and no more replies can be posted.