A very common scenario for a script is to get a file from a user, perform several actions on it and then save the file. As developers it is easy to fall into the “user is always correct” trap. We assume that if we are asking for an HTML file, the user is going to give us one. Whether the user does it on purpose or not, sometimes this isn’t the case and we, as developers, should be prepared for this use case. This blog is going to discuss how we can validate files we receive from the user.
Continue reading "LDC #156: Introduction to File Types in Legato" »