Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
TypeError: FileSystemFileHandle.queryPermission is not a function

I have a very simple function that opens a file as shown in the example on mozilla

// fileHandle is a FileSystemFileHandle
// withWrite is a boolean set to true if write

async function verifyPermission(fileHandle, withWrite) {
  const opts = {};
  if (withWrite) {
    opts.mode = 'readwrite';
  }

  // Check if we already have permission, if so, return true.
  if (await fileHandle.queryPermission(opts) === 'granted') {
    return true;
  }

  // Request permission to the file, if the user grants permission, return true.
  if (await fileHandle.requestPermission(opts) === 'granted') {
    return true;
  }

  // The user did not grant permission, return false.
  return false;
}

but I keep getting an error saying that file.queryPermission is not a function. Here's my code:

let file = await window.showOpenFilePicker();
console.log(file.queryPermission({ mode: 'readwrite' }));

I've also tried putting the console.log in a .then but had the same result.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you use Firefox or Safari or older versions of other browsers, then according to MDN and Can I Use queryPermission is not supported in these browsers. Perhaps you should check your browser's support for this feature.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!