Skip to content

Commit

Permalink
add Accept attribute on input.file
Browse files Browse the repository at this point in the history
The accept attribute on an <input type="file"> element is used to limit the types of files that users can select when uploading. For example, if you set accept="image/*", it will prompt users to choose only image files. However, it’s important to note that this attribute only provides guidance on the types of files users should select and isn’t a foolproof security measure. Users can still bypass this restriction by manipulating their browser or the file input directly, so you should always perform server-side validation to ensure that only allowed file types are processed.
  • Loading branch information
stockhausen authored Sep 26, 2024
1 parent e1290c0 commit e43b864
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/upload.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ class="{{ $attributes->get('class') }}"
});
}"
>
<input type="file" x-ref="input">
<input type="file" x-ref="input" accept="{{ $attributes->get('accept') }}">
</div>

0 comments on commit e43b864

Please sign in to comment.