Larger Files #17118
-
Does cockpit provide a way to parse or handle files that are around 20MB or so from the local file system? Or should we use other methods? We're currently trying to read an XML file that contains a lot of meta information and reporting data and we get the error that there is "Too much data". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Can you please be a little more specific what you are trying to do, and where? Is that some standard cockpit page, or a custom one of yours? But indeed things get increasingly inefficient if you download that much data into JS and the page's working memory. At some point it's probably better to process the XML data on the server side, by running some program/script through cockpit.spawn(). |
Beta Was this translation helpful? Give feedback.
Can you please be a little more specific what you are trying to do, and where? Is that some standard cockpit page, or a custom one of yours?
cockpit.file(...).read()
should work fine with 20 MB, provided that you set an appropriatemax_read_size
(the default is 16 MiB, see docs).But indeed things get increasingly inefficient if you download that much data into JS and the page's working memory. At some point it's probably better to process the XML data on the server side, by running some program/script through cockpit.spawn().