I received an issue report that my plugin throws an exception during accesing the sd-card storage.
From technical point of view it is clear for me...but is there a way to read the file-content from the sd-card? How can I do this, is there a filemanager-methode that I can use?
Currently I am reading the file content during the file-selection event like this:
fileLocation = payload.get("origin") selectedFilename = payload.get("path") # full path on local file-storage selectedFile = self._file_manager.path_on_disk(fileLocation, selectedFilename) with io.open(selectedFile, "r", encoding="ISO-8859-1") as f: for line in f: #do somethng usefull with the line
If I try to read a file from sd-card I receive this message, after calling
octoprint.filemanager.NoSuchStorage: No storage configured for destination sdcard