diff options
author | Johannes May <johannes@may-se.de> | 2022-03-12 21:12:35 +0000 |
---|---|---|
committer | Johannes May <johannes@may-se.de> | 2022-03-12 21:12:35 +0000 |
commit | a9ee18dcbbf837225f05d4dd0186fc989a319c63 (patch) | |
tree | b8202254eefb688814e409b1fd7d5f23cb5b09e2 /src/renderer.rs | |
parent | Merge pull request #747 from svenstaro/dependabot/cargo/clap_complete-3.1.1 (diff) | |
download | miniserve-a9ee18dcbbf837225f05d4dd0186fc989a319c63.tar.gz miniserve-a9ee18dcbbf837225f05d4dd0186fc989a319c63.zip |
Allow to set the accept input attribute to arbitrary values
Diffstat (limited to '')
-rw-r--r-- | src/renderer.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/renderer.rs b/src/renderer.rs index ef7285b..c64d459 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -107,7 +107,10 @@ pub fn page( form id="file_submit" action=(upload_action) method="POST" enctype="multipart/form-data" { p { "Select a file to upload or drag it anywhere into the window" } div { - input #file-input type="file" name="file_to_upload" required="" multiple {} + @match &conf.uploadable_media_type { + Some(accept) => {input #file-input accept=(accept) type="file" name="file_to_upload" required="" multiple {}}, + None => {input #file-input type="file" name="file_to_upload" required="" multiple {}} + } button type="submit" { "Upload file" } } } |