Create Subfolder For Uploaded Docs |
5/8/2018 2:47:37 PM |
ASPRunner.NET General questions | |
I
i.NoLim author
Hello, I currently have a web app that takes basic information from a user and allows for multiple uploads. I would like to create a subfolder in the "Upload folder" and store the files for said session within the folder. I found this, but it's for asprunnerpro. https://xlinesoft.com/asprunnerpro/docs62/upload_files_to_usersfolders.htm |
|
![]() |
admin 5/9/2018 |
You can use .NET expression to specify path to upload folder and each user files can be stored in a separate folder: |
I
|
i.NoLim author 5/9/2018 |
I tried the following, as shown in the page below, but got an error message. "CUSTOMER_NAME" is a field. folder = XSession.Session["CUSTOMER_NAME"]
|
![]() |
admin 5/9/2018 |
This won't work. It is not enough to have a field named "CUSTOMER_NAME". You need to populate session variable XSession.Session["CUSTOMER_NAME"] manually and it needs to be done before page is loaded in event like BeforeProcess or ProcessRecordValues on Edit page. |
I
|
i.NoLim author 5/9/2018 |
This won't work. It is not enough to have a field named "CUSTOMER_NAME". You need to populate session variable XSession.Session["CUSTOMER_NAME"] manually and it needs to be done before page is loaded in event like BeforeProcess or ProcessRecordValues on Edit page.
|
I
|
i.NoLim author 5/10/2018 |
This won't work. It is not enough to have a field named "CUSTOMER_NAME". You need to populate session variable XSession.Session["CUSTOMER_NAME"] manually and it needs to be done before page is loaded in event like BeforeProcess or ProcessRecordValues on Edit page.
folder = "files/" + XSession.Session["TempVal"].ToString();
XSession.Session["TempVal"] = values["REQUESTOR_NAME"];
folder = "C:\\Users\\cagarcia\\Documents\\Uploads/" + XSession.Session["TempVal"].ToString();
|
![]() |
admin 5/17/2018 |
Files are uploaded to the server before user clicks 'Saved' button. This is why you need to specify upload folder before and data is entered. |
I
|
i.NoLim author 5/21/2018 |
Files are uploaded to the server before user clicks 'Saved' button. This is why you need to specify upload folder before and data is entered. If you need to move files to a folder named after one fields on the form you need to use events like AfterAdd and AfterEdit and move uploaded files to a new location creating this new folder if required.
|