NetTalk Central

Author Topic: Set "Uploads Folder"  (Read 5679 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Set "Uploads Folder"
« on: September 12, 2017, 12:30:57 PM »
Hi Guys,

Is it possible to set the "Uploads Folder" after a user logs on?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Set "Uploads Folder"
« Reply #1 on: September 12, 2017, 09:27:44 PM »
yes, the uploads folder is in
p_web.site.UploadsPath

Cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: Set "Uploads Folder"
« Reply #2 on: September 12, 2017, 11:29:10 PM »
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?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Set "Uploads Folder"
« Reply #3 on: September 13, 2017, 04:22:08 AM »
>> 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

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: Set "Uploads Folder"
« Reply #4 on: September 13, 2017, 04:44:15 AM »
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?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Set "Uploads Folder"
« Reply #5 on: September 13, 2017, 11:43:51 PM »
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

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: Set "Uploads Folder"
« Reply #6 on: September 27, 2017, 07:07:55 AM »
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?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Set "Uploads Folder"
« Reply #7 on: September 27, 2017, 09:56:19 PM »
perhaps.
Post an example app of what you have done and I'll see if you're doing it wrong.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Set "Uploads Folder"
« Reply #8 on: September 28, 2017, 03:38:28 AM »
Rupert, this is what I do in RenameFile before PC:

  self.site.UploadsPath = clip(self.site.WebFolderPath) & '\uploads\' & 'MyNewSubFolder'

and it works ok,

Regards

-----------
Regards
Alberto