I am trying to save a squirrel blob from the imp and store it with server.setpermanentvalues(). However the information is not being stored correctly. I believe this is because I have to save each blob index as its own key with corresponding value within the server table. Is there an easy way to do this? I am trying to save a blob of length 500 to the server.
Unless it’s already a UTF-8 string, you need to Base64-encode it for it to be serialisable in server.setpermanentvalues: server.setpermanentvalues({savedvalues = http.base64encode(outBlob)}); [...] outBlob = http.base64decode(server.permanent.savedvalues);
Oh whoops, that’s only available in agents, not on the imp itself, sorry. At this point perhaps you are best advised to use an array, as you said to start with. We’ll have a think about how to support this sort of technique better in future.
Agent access to server.setpermanentvalues (or, indeed, to “server.save”, which we later realised was a better name for it) is coming soon. Then your much neater solution above will become the best way of doing it!
Can each different impee save its own values with server.setpermanentvalues ? Is there only one table available (meaning all impees will save to same table), or does each impee get its own table?