×Please log in to post a message
  • Alok Menghrajani
     

    If you run the following piece of code and hit "save" followed by "load", the data you'll get back will be incorrect. (build 3521).

    import stdlib.crypto
    database demo {
      binary /blob
    }
    server function log(x) {
      jlog(Debug.dump(x))
    }
    function do_save(_) {
      data = Crypto.Base64.decode("/xAg")
      log(data)
      /demo/blob <- data
      Dom.set_value(#value, "saved")
    }
    function do_load(_) {
      data = /demo/blob
      log(data)
      Dom.set_value(#value, Crypto.Base64.encode(data))
    }
    function page() {
     <div>
       <input type="button" onclick={do_save} value="save"/>
       <input type="button" onclick={do_load} value="load"/>
       <input type="text" id=#value/>
     </div>
    }
    Server.start(Server.http, {{title: "Completion example",  page: page}})
    
  • Alok Menghrajani
     

    Workaround is to base64 encode the data before storing it as a string, and then base64 decoding it after loading.

  • quentin bourgerie
     

    Thanks for report, I pushed a fix on github.

The browser you use is not supported by this application, probably because it lacks some critical features.
For a better experience, please consider using this application with a supported browser.