Quiz

  1. What is a BLOB and are they used outside of MySQL databases?

    BLOB is a "binary large object": a representation for some chunk of bits. Often a BLOB comes from an image, video, or audio, but might be some proprietary custom represenation.

    The database can store such things, but they are annoying to work with.

    Yes, BLOBS can appear in other situations. For example, there's a Blob API in JavaScript in the browser. Streaming applications often work with BLOBs.

  2. Could you explain more what "enctype = multipart/form-data" means? What is enctype, and what would be another enctype?

    ENCTYPE is the encoding type, which is a way of serializing some data as text.

    For HTML forms, there are really only two choices:

    application/x-www-form-urlencoded, which is the default and looks just like a query string: x=3&y=4

    multipart/form-data which serializes all the files, kinda like TAR does.

  3. Could we please go over an example on how to use request.files in flask?

    We'll go over a complete, working example!

  4. Does Flask check if the file type matches what the file name ends with? Like what could happen if that is let through?

    and also:

    Can you talk a bit more about how Flask checks the actual file type or does it just trust the filename extension?

    and also

    if a file name has relative path sequences, does that get cleaned or do we need to implement code to do it manually?

    Great questions! Flask mostly leaves this up to you.

    You inspired me to add a short appendix to the reading on forms