Converting files to Strings
This page helps you to convert a file into a quoted JavaScript string of bytes.
NOTE: The Web IDE now provides a 'Storage' window which allows you to upload/download files from an on-chip filesystem. This would normally be the preferred way to upload files to Espruino if it doesn't make sense to put them directly into a Templated String.
It's useful if:
- You're making a webserver and you want to encode an image in a string.
- You want to turn a raw bitmap into something that you can send to a display (you may also want to look at the Image Converter in that case).
To use it just click 'Choose File'. Once the file is chosen, various string representations of it will be output in the text area below. You can then copy and paste them into your JS code.
As :Result
...
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.