mySCADA
myDESIGNER › myDESIGNER › Views & Layout

View script function - Retrieving files

On this page

You can get files from project data folder or from user data folder (saved in runtime). First passed argument is name of file, second is your callback function, this callback function is called when file is downloaded.

Will retrieve file from User files Folder (file saved in project)

myscada.getFileFromUserFiles(‘file.csv’,function(data) {

//in data is your retrieved file

});

Will retrieve file from User data folder (file saved in runtime)

myscada.getFileFromUserData(‘file.csv’,function(data) {

//in data is your retrieved file

})

Retrieving files from specific URL location

To retrieve file using a GET command from any location on the sever, please use following function:

myscada.getFileFromUrl(url, callback, error);

First parameter is the url for the data, second parameter is the callback function to be called on successful file retrieval, last parameter is a callback function to be called on error.

Sending data to specified location by URL

You can send data using POST message to given url by using following function

myscada.sendDataToUrl(url,data, callback, error);

First parameter is the url for the data, second parameter are the data to be send, third parameter is the callback function to be called on successful file retrieval, last parameter is a callback function to be called on error.