Referencing Upload Files

This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
Post Reply
rpathak
Posts: 7
Joined: August 24th, 2023, 9:25 am
Contact:

Referencing Upload Files

Unread post by rpathak »

We have two applications 5.1 and MVC, We have created similar functionality widgets in both applications to upload the files(csv/xls), these files are just given the info of the item numbers and the quantity and after using that service we can upload the selected file items to the save cart lists.

In those widgets, we have a service called "Save file" that we use to save on a temporary basis so on that file name we have hardcoded as UploadeFiles and after that, we add the suffix as date, but in 5.1 it works as expected but in the MVC we are getting the error as :
"Web Server Error: File UploadFiles not found in HTTP Request for upload. Make sure your Webpage/Widget has AjaxEnabled set to False. Make sure the button that is used to upload the file has DisplayProgressAnimation and AjaxEnabled set to false."

Below is the structure of the widget(MVC):
image.png
Below is the structure of the widget(5.1):
image.png
For both, we have a file upload process.

Structure of Upload Controller (MVC):
image.png
Structure of Upload Button (5.1):
image.png
below is the structure of the save file service where we are getting the error:
MVC:
image.png
5.1:
image.png
we have the same implementation on the MVC as 5.1, but after selecting the file we get an exception as shown below:
image.png
Need to fix this exception to run the service smoothly, I am stuck here so I need help to resolve this issue, let me know if I am missing anything or if we have to make the implementation differently.
word count: 266

Tags:
JustinVanRegenmorter
Posts: 573
Joined: August 26th, 2021, 9:56 am
Contact:

Re: Referencing Upload Files

Unread post by JustinVanRegenmorter »

Hello rpathak,

Can I confirm that if you select the UploadFromFile control on the canvas and search for the property AjaxEnabled it should be set to false. Then on the control that submits the file confirm that the properties AjaxEnabled and DisplayProgressAnimation are both false.

Best Regards,
Justin
word count: 48
rpathak
Posts: 7
Joined: August 24th, 2023, 9:25 am
Contact:

Re: Referencing Upload Files

Unread post by rpathak »

Hi Justin,

Thanks for your suggestion, I have tried to do so but didn't find the property "AjaxEnabled" on the widget page as well on the button control as shown below:
image.png
image.png
Do let me know if I am missing anything on this.
word count: 43
JustinVanRegenmorter
Posts: 573
Joined: August 26th, 2021, 9:56 am
Contact:

Re: Referencing Upload Files

Unread post by JustinVanRegenmorter »

Hello rpathak,

On the Upload button control make sure the "DisplayProgressAnimation" property is set to false. Also make sure the SaveToDirectory path in the SaveHttpPostedFile service is set to the relative directory instead of the absolute directory. On the Platform installation all file related services take a relative file path.
word count: 50
rpathak
Posts: 7
Joined: August 24th, 2023, 9:25 am
Contact:

Re: Referencing Upload Files

Unread post by rpathak »

Hi Justin,

I have made changes as per your suggestion, as the "DisplayProgressAnimation" property is set to false.

But I am not sure about changing the SaveToDirectory path in the SaveHttpPostedFile service to the relative directory instead of the absolute directory, how can we do so?

Currently, for SaveToDirectory we are using the GetApplicationProperties/Output/Result/ApplicationRoot and that value is "C:\EASYProcess51\Platform\DV\Applications\100048\" shown in the below image, what would be the relative directory for this?
image.png
Also, I wanted to know that currently, it is using the EASYProcess51 location but this application is related to MVC so, don't we have to use the MVC location?

Thanks
Rajendra Pathak
Attachments
image.png
image.png
word count: 113
JustinVanRegenmorter
Posts: 573
Joined: August 26th, 2021, 9:56 am
Contact:

Re: Referencing Upload Files

Unread post by JustinVanRegenmorter »

Hello rpathak,

So you know EASYProcess 5.1 is the application itself while MVC and Classic are types of applications you can create in EASYProcess 5.1.

As for using the relative vs absolute paths all you need to do is take out the xsl:value-of on the ApplicationRoot. The rest is the relative path which you can also confirm by navigating to the Static Files page via the menu in the IDE. This will show you all files and folders in both the web and app server along with the ability to copy the relative paths.

Best Regards,
Justin
word count: 101
rpathak
Posts: 7
Joined: August 24th, 2023, 9:25 am
Contact:

Re: Referencing Upload Files

Unread post by rpathak »

Hi Justin,

Thanks for the information, I have implemented it as per your suggestion.

As per your suggestion, I have created the folder at the common static file location as shown below:
image.png
After that, I implemented the changes on the savefile service shown below:
image.png
But after that also I got the same error as previous while testing shown below:
image.png
Then after I checked the logs and found the exception we were getting earlier,
image.png
Can you help me with what should I do next or if I have made any mistakes while implementing?
word count: 92
JustinVanRegenmorter
Posts: 573
Joined: August 26th, 2021, 9:56 am
Contact:

Re: Referencing Upload Files

Unread post by JustinVanRegenmorter »

Good afternoon Rajendra,

After looking over your posts and screenshots a bit more it seems there was a bit of confusion. I see that you are using the DNDFileUpload control. This control automatically saves files to the specified location without the need for a controller call. In the properties under the Appearance section you can fill out the SaveLocation (set to Web or App) and Path properties to determine where to save the files. You do not need the SaveHttpPostedFiles service as this is a Classic Application only service.

Best Regards,
word count: 91
Post Reply