MATLAB Answers

Web App Server Read/Write Permissions

7 views (last 30 days)
Tyler Onkst
Tyler Onkst on 27 Jan 2020
Answered: Kojiro Saito on 31 Jan 2020
I recently installed the web app server and am trying to run an app where the user types values into a bunch of numerical edit fields and then clicks "submit" and it populates the next line in an already existing xlsx file. When I run the app from the app designer software it works perfectly. When I compile it via the webAppCompiler and try it out online it will error out on the "readcell" function of my app when it tries to reach a file that I have hardcoded to see what previous inputs are already there.
I tested it out with a uigetfile popup and that seems to work although I don't want the user to have to go searching for the file. The gui is also not saving any of the user inputs to the file, it's not erroring out it's almost like it's just ignoring the writematrix command I have that appends the user inputs to the spreadsheet and saves.
After digging around online it seems like the problem might be associated with the read/write permissions for the web app server? We originally had it setup with the "MwWebAppsGuestR2019a" account and have been trying to change it to something that has more permissions. We setup a new user with essentially admin priviledges and it's still getting stuck reading files from a hardcoded path and writing to files. Are there more detailed instructions for setting up the Service Registration of the Web App server? Am I just running into the limitations of webapps with the functions I'm using?
Any help is appreciated. Thanks!


Kojiro Saito
Kojiro Saito on 29 Jan 2020
Do you get any error log? You can find the Web App log by clicking "Show Log" in the left bottom.
Tyler Onkst
Tyler Onkst on 29 Jan 2020
I'm getting an error during the "readmatrix" portion of my code. Says "unable to find or open 'O:folder\folder\file.xlsx'. Check filename or file permissions".
My code is essentially just:
excelfile = "O:\folder\folder\file.xlsx";
TCUsage = readmatrix(excelfile,'Sheet','Trailer Hours','Range','C4:DO10000');
And as I mentioned, it works fine within the appdesigner software, only once it's compiled does it stop working.
The O drive is a shared network drive, we've also attempted this code with files on the C drive as well with the same error.

Sign in to comment.

Answers (1)

Kojiro Saito
Kojiro Saito on 31 Jan 2020
About O drive, please confirm that Web App can see the drive. Does the following work in Web Apps?
ls O:
If, not the network driver is not mounted as O drive from Web Apps user (MwWebAppsGuestR2019a). In this case, hostname or local IP address of the network drive would work, for example, if the hostname is servershared and its IP address is, \\servershared or \\ instead of O:\ would work.
About the file permission, please check the xlsx file can be accessed from Web Apps user (MwWebAppsGuestR2019a). You can check the file permissions from right click the xlsx file in File Explorer and go to Properties, then check the Security tab.


Sign in to comment.





Translated by