Skip to Content
Platform.Ontology

File metadata (name, size, type, modified time)

Shows name, byte size, MIME type and last modified time of any file the person shares.

Gets silentlyFiles and storageFilesWeb browsersWhile you use it

In one line

Can see the name, size, type and last changed date of files you share

Shows name, byte size, MIME type and last modified time of any file the person shares.

Metadata alone can reveal a lot: camera model names, document names, dates of work. The MIME type comes from the person's OS file associations, which also differs between machines.

What it can and can't do

What the user does: You pick or drop a file onto the page.

It can

  • See each file's name and size
  • See its type and last changed date
  • Check the file before it uploads, and refuse it if too big

It cannot

  • See the full folder path on your computer
  • See files you did not share
  • Learn more than that without opening the file's contents

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported132011-08-02None
EdgeSupported122015-07-29None
FirefoxSupported3.62010-01-21None
SafariSupported82014-10-16None
Safari on iPhoneSupported82014-09-17All iOS browsers use WebKit
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIFile.name, size, type, lastModified, webkitRelativePath; Blob.slice(), arrayBuffer()
Browser compat keysapi.File.name
api.File.lastModified
api.Blob.type
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsWhile the File object lives
How to take it backNothing to revoke (no permission is stored)
Inside an iframeSame origin, per file

Typical flow

  1. Person shares a file via input, drop, paste or picker
  2. Page reads the File properties
  3. Page can slice and read bytes

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • Only for files the person selected, dropped or pasted
  • No full path, owner, creation time or hash; lastModified is milliseconds since epoch (filesystem precision may be 1 s or 2 s)
  • Firefox resistFingerprinting rounds lastModified (to 100 ms or more) and sets type from extension only
  • type is guessed from the extension via the OS registry (Chrome, Windows and macOS differ for unknown types such as .md)
  • EXIF and document properties are not exposed natively but can be parsed by the page from the bytes (GPS in photos)

The story

What it is

Shows the name, size, type and last changed time of any file you share.

For you

The page sees the name, size, kind and last changed time of each file you give it. You never see it read, but it is why an upload checks the size first.

For makers

Makers use it to block files that are too big or of the wrong kind before upload. The same details can reveal when a file was made and what kind of device made it.

Where you see it

TypeExampleApps
socialA site refuses a video larger than its limit before you wait for it to upload.YouTube, Instagram
bankingA loan portal checks that your uploads are PDFs or photos, not other file types.None named
securityA fraud team reads the last changed time of an uploaded ID photo to see if it was just edited.None named
gamesA mod site checks the name and size of a mod file for known cheats.None named
creativeA music tool reads the file name and type to pick a sound format.None named
educationA homework site checks that the file was last changed before the deadline.None named
enterpriseA document system uses the last changed time to decide which copy is newer.None named

Risks

  • Reveals file history
  • Could hint at your device

What the platform says

  • MDN: File API. Documents how a page can read basic details of a file a person has chosen.

Good uses and abuse

Legitimate uses

  • Validate upload types and sizes
  • Sort by date

Known abuse

  • Extracting EXIF GPS and device model from photos
  • Fingerprint by installed apps (MIME registry)

Scores

ScoreValueMeaning
Sensitivity3 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3Rough identifying entropy, when known

History

  • 2015, Chrome 42: File.lastModified (replacing lastModifiedDate)

Sources

How well checked: Based on official documentation.

On this page