Restrict file picker extensions

This commit is contained in:
Gabriel Augendre 2023-01-04 13:57:05 +01:00
parent 089654dab1
commit 44de537459
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@
</div>
<form class="w3-margin w3-center w3-card w3-padding-24" action="/upload" method="POST" enctype="multipart/form-data">
<input type="file" accept="audio/*" name="file">
<input type="file" accept=".mp3,.wav" name="file">
<input type="submit" class="w3-button w3-blue">
</form>

View file

@ -58,7 +58,7 @@ byte currentVolume = 12;
bool fileIsValid(String fileName)
{
return !fileName.startsWith(".") && (fileName.endsWith(".mp3") || fileName.endsWith(".aac") || fileName.endsWith(".wav"));
return !fileName.startsWith(".") && (fileName.endsWith(".mp3") || fileName.endsWith(".wav"));
}
void clearMessageArea()