Question · Vibe coding with Claude Code course · Module 7: LinkedIn clone

Quiz: The resume file type

Why does the server check the resume by the first bytes %PDF- and not with z.file().mime(["application/pdf"])?

Answer options

  • mime() works only in the browser, not on the server
  • The first bytes are checked faster than the file size
  • Without checking the bytes the file will not fit in the 1 MB limit
  • mime() compares file.type, which the browser guesses from the extension, so a renamed image would pass

You can check the correct answer by solving this task in the CodeWorlds game.