This shows you the differences between two versions of the page.
ii:labs:s2:03:tasks:04 [2022/05/04 14:05] radu.ciobanu created |
ii:labs:s2:03:tasks:04 [2024/04/01 21:39] (current) florin.stancu created |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== 04. [30p] Writing a Dockerfile ==== | + | ==== 04. [20p] Bonus: file upload ==== |
+ | |||
+ | Bonus task: add a upload image input inside the ''account-details'' that uploads a file to the ''public/images/profile'' subfolder (also: create it!): | ||
+ | |||
+ | * Use ''type="file"'' attribute on the ''<input>''; | ||
+ | * Use ''multipart/form-data'' encoding type attribute on the ''<form>'' (Google it!); | ||
+ | * Inside the Flask route function: | ||
+ | * Actually, [[https://flask.palletsprojects.com/en/3.0.x/patterns/fileuploads/|Read The Fine Manual]] for this! | ||
+ | * Finally, add an ''<img>'' tag to display the profile photo on the user's account page when everything is done! |