Address issue#61 by allowing only recognized file types to be picked for upload

This commit is contained in:
Daniel Markstedt 2021-09-20 15:22:48 -07:00
parent 03e1a961f3
commit a2a805b426
2 changed files with 3 additions and 3 deletions

View File

@ -167,13 +167,13 @@
<hr/>
<h2>Upload File</h2>
<p>Uploads file to <tt>{{base_dir}}</tt>. Max file size is set to {{max_file_size / 1024 /1024 }}MB</p>
<p>Uploads file to <tt>{{base_dir}}</tt>. The largest file size accepted is {{max_file_size / 1024 /1024}} MB</p>
<table style="border: none">
<tr style="border: none">
<td style="border: none; vertical-align:top;">
<form action="/files/upload" method="post" enctype="multipart/form-data">
<label for="file">File:</label>
<input type="file" name="file" />
<input type="file" name="file" accept="{{valid_file_suffix}}" />
<input type="submit" value="Upload" />
</form>
</td>

View File

@ -73,7 +73,7 @@ def index():
running_env=running_env(),
server_info=server_info,
netinfo=get_network_info(),
valid_file_suffix=", ".join(VALID_FILE_SUFFIX),
valid_file_suffix="."+", .".join(VALID_FILE_SUFFIX),
removable_device_types=REMOVABLE_DEVICE_TYPES,
harddrive_file_suffix=HARDDRIVE_FILE_SUFFIX,
cdrom_file_suffix=CDROM_FILE_SUFFIX,