This topic is locked

File Upload Custom PHP Expression, subfolder by month and year

7/13/2013 8:58:20 PM
PHPRunner General questions
B
bussb author

Hello, I have a PHPRunner 6.2 application where I upload files into a custom folder defined by the php expression
$folder = "../../../primary/files/" . $_SESSION['SOrgID'] . "/audits";
What I would like to add is a custom expression that also creates sub-folders by year and month such as
$folder = "../../../primary/files/" . $_SESSION['SOrgID'] . "/audits/2013/07";
The last part, /2013/07 would be defined dynamically based on current server time and change when the month and year changes.
Is there a way to do this?

C
cgphp 7/14/2013
$month = date('m');

$year = date('Y');

$folder = "../../../primary/files/" . $_SESSION['SOrgID'] . "/audits/".$year."/".$month;