mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-22 23:55:12 +00:00
LibWeb: Set the MIME type when creating an <input> element's File list
We were passing the MIME type to the underlying Blob, but the factory for creating a File only checks an explicit options structure.
This commit is contained in:
committed by
Andreas Kling
parent
0cc8698a62
commit
f55471333b
@@ -422,7 +422,11 @@ void HTMLInputElement::did_select_files(Span<SelectedFile> selected_files)
|
||||
// FIXME: The FileAPI should use ByteString for file names.
|
||||
auto file_name = MUST(String::from_byte_string(selected_file.name()));
|
||||
|
||||
auto file = MUST(FileAPI::File::create(realm(), { JS::make_handle(blob) }, file_name));
|
||||
// FIXME: Fill in other fields (e.g. last_modified).
|
||||
FileAPI::FilePropertyBag options {};
|
||||
options.type = mime_type.essence();
|
||||
|
||||
auto file = MUST(FileAPI::File::create(realm(), { JS::make_handle(blob) }, file_name, move(options)));
|
||||
files.unchecked_append(file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user