This topic is locked
[SOLVED]

 Giving the uploadfolder the users name

12/26/2014 3:44:19 AM
PHPRunner General questions
S
shoppy author

In 2013 I found a solution for the problem I had.

It was this topic: http://www.asprunner.com/forums/topic/20953-store-files-outside-phprunner-directory/
After some changes I forgot that I had to change the files manually and I overwrote the changed files.
In the topic I state what the solution was to write files to a folder that holds the user's name but I forgot what to put in the prefix (Visual Editor).
Can anyone help?
John (shoppy)

S
shoppy author 12/27/2014

Found it!!
In include/commonfunctions.php you manually need to find the line(s) with the prefix to the folders you like to change.

Then (in my case) change the prefix at the end to files/".$_SESSION["UserID"].'/';
So the prefix(es) in include/commonfunctions.php looks like

http://www.yoursite.com/files/projectstukken/".$_SESSION["UserID"].'/';;


Now you have to manually change the event file for uploading the file in the right folder.
In the 'include' folder you have to find the event file that handles your documents.

In my case it was the include/_Projectstukken_settings.php ducument.
Around line 105 you find this line $fdata["UploadFolder"]="your dir/";

Change it in

$fdata["UploadFolder"]="your dir/".$_SESSION["UserID"];



(rename "your dir" into the name of the directory where you store your files)
Of course you have to manually add the right folders.
That's all.