This is an old revision of the document!


04. Advanced: File upload

As a final task, we want to upload some files using our web application.

  • Create a new upload.html form page with a <input type=file …> field (and, ofc., a submit button!);
    • Note: you need to use multipart/form-data form encoding for HTTP file uploading to work.
  • Create the appropriate Flask route that serves the upload.html page;
  • Enhance your route function to save the uploaded file on disk (e.g., the upload/ directory);
  • Finally, test it!
ii/labs/s2/01/tasks/04.1679081434.txt.gz · Last modified: 2023/03/17 21:30 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0