I am setting up a server to process data uploaded to it remotely. I'm using Matlab Web Apps to do the processing but I need to provide the app with the location of the files. I have this all working in AppDesigner by supplying the app with input arguments but there does not seem to be any information on how these work in Web Apps or whether it is supported at all (at least, not in the list in the Matlab help about what AppDesigner features that aren't supported in Web Apps).
Does anyone know if this is possible/impossible and, if possible, how it works?
Many thanks in advance.

 Réponse acceptée

Chris Portal
Chris Portal le 9 Juin 2018

0 votes

Currently, it’s a limitation, but there’s a workaround. This is what the doc says:
“Opening files and folders on the client, or loading and saving files on the client via uigetfile, uiputfile, and uigetdir is not supported. As a workaround, MATLAB file I/O functions such as readtable, load, and fread will work if the file or folder is on a network location accessible by both the client and server.”

7 commentaires

Huub Bakker
Huub Bakker le 10 Juin 2018
Hi Chris,
My question isn't about whether I can access the files (they are on the server so there is no issue) but whether I can tell the app where the files are. In the AppDesigner I do that by calling the app with the path to the files as an input argument. My question relates to how to do that with a Web App. Where does it get its input arguments from? Intuitively, you would think that it was part of the URL; something like "http://localhost:9988/webapps/home/session.html?app=handleFilesApp?inputArg1?inputArg2" but I can't find anything on how to do this nor anything that says that you can't use input arguments with Web Apps.
Can you point me in the right direction here?
cheers
Huub
Chris Portal
Chris Portal le 10 Juin 2018
Ah, thanks for clarifying. There isn't a way of invoking a web app with an input argument right now. It is an open enhancement request for the team to work on. The only workaround I can think of is to have a text field in the app where you can enter in the path to the files.
Huub Bakker
Huub Bakker le 10 Juin 2018
Many thanks. I will find a workaround. Just needed to be sure that it wasn't supported.
Klemen Peter Kosovinc
Klemen Peter Kosovinc le 3 Oct 2018
Dear Hubb, did you maybe find the workaround? Did anything change with new release of Matlab (R2018b)? Thanks, Klemen
Huub Bakker
Huub Bakker le 3 Oct 2018
Yes. Just hardwire the location of a configuration file into the Web App and then load the file with the location of the files you want to work on. A bit more roundabout, but still OK.
Julian Krebs
Julian Krebs le 8 Juin 2020
Any updates with R2019b/R2020b? Read url parameters with something like "?denomerator =3x+8x&numerator=8x^2" would be very helpful for WebApps. Actual best solution is to save preferences in configuration file and read it form other WebApp, right? Is there any example code for this?
Thanks!
Amir Abedin
Amir Abedin le 11 Juil 2020
I guess there is no update yet

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Web App Server dans Centre d'aide et File Exchange

Produits

Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by