| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/API/HTMLInputElement/files | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
HTMLInputElement.files <input type="file"> FileList .
FileList . **HTMLInputElement** type="file" null.
HTMLInputElement.files , , .
<input id="files" type="file" multiple />
**HTMLInputElement.files** FileList . for...of .
const fileInput = document.getElementById("files");
console.log(fileInput.files instanceof FileList); // .
for (const file of fileInput.files) {
console.log(file.name); //
let fileDate = new Date(file.lastModified);
console.log(fileDate.toLocaleDateString()); //
console.log(
file.size < 1000 ? file.size : Math.round(file.size / 1000) + "KB",
);
console.log(file.type); // MIME
}
| Specification |
|---|
| HTML # dom-input-files-dev |
This page was last modified on 2025 6 27 by MDN contributors.
HTMLInputElementacceptalphaaltautocompletecapturecheckedcolorSpacedefaultCheckeddefaultValuedirNamedisabledfilesformformActionformEnctypeformMethodformNoValidateformTargetheightindeterminatelabelslistmaxmaxLengthminminLengthmultiplenamepatternplaceholderpopoverTargetActionpopoverTargetElementreadOnlyrequiredselectionDirectionselectionEndselectionStartsizesrcsteptypevalidationMessagevalidityvaluevalueAsDatevalueAsNumberwebkitdirectorywebkitEntrieswidthwillValidateYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |