Add FileList constructor
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- html, javascript
調査の方向性
まず、FileList constructor のリクエストと、issue に記載された file-input、File-object、drag-and-drop、XHR の動作を確認します。関連する仕様テキストやテストを探す前に、意図する代入セマンティクスと完了基準を定義してください。issue にはリポジトリのファイルもテストのエントリポイントもありません。
索引モデルが issue の本文から書いたものです。
説明
Split out from https://www.w3.org/Bugs/Public/show_bug.cgi?id=17125 :
The
<input type="file" name="something" />
element has always been readonly (you can't change value) for security purposes.
That makes sense as a string could always be manipulated by JS.
The File object on the other hand should be "safe", as in
- Only the browser can create one on user request (ie. by file input or drag and drop)
- JS cannot change it in any way
So it should not be a security issue to allow assignment to a file input.
For example:
<input type="file" name="something[]" onchange="splitFiles();" id="in1" multiple="multiple" />
function splitFiles() {
var in = document.getElementById('in1');
//create single inputs
for(var i=0;i<in.files.length;i++) {
var newEl = document.createElement('input');
newEl.name = "something[]";
newEl.id = '...';
newEl.type = "file";
newEl.value = in.files[i]; // <-- assignment of file object
document.appendChild(newEl); //add for upload
//create some UI to remove this input
//...
}
//remove the multi-input
in.parent.removeChild(in);
}
This code would split a multi-file-input back to multiple single-file inputs (that way applications with a legacy backend that only supports the classical way could also support multi-file-inputs).
Another use would be with File objects obtained by drag and drop.
Right now those require XHR to upload. Allowing to make them a selection of a file input could simplify some situations as well as provide richer UI (when showing a traditional file input together with a drop area those would stay in sync).
- 主要言語
- HTML
- スター
- 118
- フォーク
- 52
- 平均マージ
- 9日 16時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
w3c/FileAPI のほかの issue
-
TPAC2026
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
avniproject/avni-client#2135 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3276 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
good first issue refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100