NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: rupertvz on September 12, 2017, 12:30:57 PM
-
Hi Guys,
Is it possible to set the "Uploads Folder" after a user logs on?
-
yes, the uploads folder is in
p_web.site.UploadsPath
Cheers
Bruce
-
Thank you Bruce,
I included the following line in WebHandler procedure:
p_web.site.UploadsPath = 'C:\MyWebsite\web\uploads\'&CLIP(P_Web.GetSessionValue('GLW:UserProfile'))
After the parent call for "SetSessionLevel"
It is correctly after the user logs on, but does not change / update the Uploads Folder.
Files are still being uploaded to the default path?
-
>> After the parent call for "SetSessionLevel"
Seems like a strange place to put it Rupert - what's your thinking there?
I would likely have suggested ProcessLink, before parent call.
Cheers
Bruce
-
Thank you Bruce,
My thinking was to "update" the "uploads" folder, only After the user logged on.
I have to redirect the "Upload Path" to the "UserProfile" directory.
p_web.site.UploadsPath = 'C:\MyWebsite\web\uploads\'&CLIP(P_Web.GetSessionValue('GLW:UserProfile'))
I've added the code to ProcessLink (before parent call) but doesn't seem to update with the user-profile path?
-
Hi Rupert,
p_web.site.UploadsPath
is a threaded variable, limited to a single request. It's not a session value.
>> only After the user logged on.
so a change there _only_ applies to this thread.
>> I've added the code to ProcessLink (before parent call) but doesn't seem to update with the user-profile path?
presumably the session value of GLW:UserProfile is not set.
cheers
Bruce
-
Hi Bruce,
I've added a static path to "p_web.site.UploadsPath"
* Before parent call of "ProcessLink" in WebHandler.
This didn't change the default path for uploading documents, it still goes the original location.
Should I perhaps update somewhere else?
-
perhaps.
Post an example app of what you have done and I'll see if you're doing it wrong.
cheers
Bruce
-
Rupert, this is what I do in RenameFile before PC:
self.site.UploadsPath = clip(self.site.WebFolderPath) & '\uploads\' & 'MyNewSubFolder'
and it works ok,
Regards