This topic is locked

Using a Customized File Attachment Path with Primary Key

12/28/2012 6:14:24 PM
PHPRunner General questions
B
bussb author

I have experimented with the great new feature of PHPRunner 6.2 customizable file paths using session variables:
$folder = "userfiles/".$_SESSION["UserID"];
Now, is it possible some way to create a path that also includes the primary key value?
userfiles/bsmith/100

userfiles/bsmith/101

C
cgphp 12/30/2012

The primary key is only availabe after the record has been added. You need some sort of logic based on session variables.

B
bussb author 1/7/2013

OK, so using the PHP Expression option I have this now, but I am getting a Syntax error with the php expression below:
ERROR: Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

$folder = "../files/".$_SESSION['SOrgID']"/tblEquipment";


where $_SESSION['SOrgID'] is an integer value that is properly assigned based on which client is logged in. So I want sub-folders of attachments based on the client "SOrgID" located in a folder one level up from the output folder.
/files/100/tblEquipment/slkdasldfkj.pdf

/files/100/tblEquipment/dsafkjsf.doc

/files/100/tblEquipment/dfwefhdsa.txt

/files/149/tblEquipment/hjskedasldfkj.pdf

/files/149/tblEquipment/dsafks29120ds.doc

/files/200/tblEquipment/dfwdsdeusdsa.txt

/files/205/tblEquipment/s839dadyes$j.pdf

/files/100/tblEquipment/dafld324f.doc

/files/100/tblEquipment/dfwef34234^a.txt
Something wrong with my single and double quotes?

C
cgphp 1/7/2013
$folder = "../files/" . $_SESSION['SOrgID'] . "/tblEquipment";