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 d31db7c316
commit 57bbcbd639
2 changed files with 3 additions and 3 deletions

View File

@ -167,13 +167,13 @@
<hr/> <hr/>
<h2>Upload File</h2> <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"> <table style="border: none">
<tr style="border: none"> <tr style="border: none">
<td style="border: none; vertical-align:top;"> <td style="border: none; vertical-align:top;">
<form action="/files/upload" method="post" enctype="multipart/form-data"> <form action="/files/upload" method="post" enctype="multipart/form-data">
<label for="file">File:</label> <label for="file">File:</label>
<input type="file" name="file" /> <input type="file" name="file" accept="{{valid_file_suffix}}" />
<input type="submit" value="Upload" /> <input type="submit" value="Upload" />
</form> </form>
</td> </td>

View File

@ -73,7 +73,7 @@ def index():
running_env=running_env(), running_env=running_env(),
server_info=server_info, server_info=server_info,
netinfo=get_network_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, removable_device_types=REMOVABLE_DEVICE_TYPES,
harddrive_file_suffix=HARDDRIVE_FILE_SUFFIX, harddrive_file_suffix=HARDDRIVE_FILE_SUFFIX,
cdrom_file_suffix=CDROM_FILE_SUFFIX, cdrom_file_suffix=CDROM_FILE_SUFFIX,