Web App Server Read/Write Permissions

6 views (last 30 days)
Tyler Onkst
Tyler Onkst on 27 Jan 2020
Answered: Ayush Narsaria on 15 Dec 2023
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!
  2 Comments
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:
%Filename
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 (2)

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 192.168.0.10, \\servershared or \\192.168.0.10 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.
  1 Comment
Safwana Razak
Safwana Razak on 13 Jun 2021
hi Kojiro, how to add the file permision in the secutiy tab so it can be accessed from Web Apps?

Sign in to comment.


Ayush Narsaria
Ayush Narsaria on 15 Dec 2023
I have a similar question. I have multiple excel files stored on my local disk that are being read in a Matlab script and some evaluations are done. That .m script is being called from a .mlapp file. Now when I deploy the .ctf file on webapp server, those excel files are not being read as those files are not present on the server location. Also, the current directory (pwd) keeps changing of the server and I am not sure if I can store those files somewhere in the server location.
I do not want to use uigetfile as the number of files are quite a lot and not every user would have access to those files.
Can you please suggest a solution?
Thank you

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Tags

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!