JavaScript: download file with fetch

In this post you will learn how to download a file in the background using client-side JavaScript and the fetch function to make HTTP requests. We will see how to download a file as a blob using AJAX and then ask the user where to save it, suggesting a name. The good thing about this is that we can send parameters to request the download of the file (for example, we can send a password over a POST request if the server requires it). ...

October 6, 2023 · 2 min · 351 words · Parzibyte

JavaScript: store and read files with the Origin Private File System

In this post you will learn how to use the Origin Private File System with JavaScript to store, read and remove any file on the web browser. You may try the demo here: https://stackblitz.com/edit/vitejs-vite-hl34zf?file=index.html As I said before, the Origin Private File System has arrived to revolutionize things with JavaScript. Thanks to OPFS we can have a complete file system with JavaScript directly in the web browser. With this new technology, we can write any type of file in the web browser, as well as download it later. All of this without depending on localStorage or similar things; It is a different technology. Text documents, images, videos and even databases can be saved, and there is no need to ask the user for permission or confirmation, everything is transparent. ...

October 6, 2023 · 5 min · 1064 words · Parzibyte

Send bytes to thermal printer with C# and ESC POS

In this article I will show you how to use native C# to open a thermal printer as a file and send it bytes or data including ESC POS commands. Remember that I already have a plugin that allows you to print on thermal printers and exposes a consumable HTTP API from any programming language so that you can use it and not implement your own library, but if you want to see how it’s done, keep reading. ...

January 9, 2023 · 3 min · 542 words · Parzibyte