[SOLVED] GH File Upload Action - Create folders by user id

momentis 10 Dec, 2012
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
GreyHead 10 Dec, 2012
Hi Rick,

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
momentis 10 Dec, 2012
Oh yeah!! That worked perfectly. Thanks!!!!
😀 😀

Rick
This topic is locked and no more replies can be posted.