0

I want to save a file with data input by the user on a website to the user's device using showSaveFilePicker() in Javascript (purely locally used).
This is currently not supported by all browsers, especially not on mobile devices.
I need a way to check, if the browser used is offering showSaveFilePicker(), so that I can offer a download to the standard folder if showSaveFilePicker() is not available.
How can I check for that?

Using try-catch does not work, as the error will also be thrown when the user aborts saving - which should of course not lead to a saving of the file.

Neha Soni
  • 3,935
  • 2
  • 10
  • 32

1 Answers1

0

I found the solution:

Check the availability with
if('showOpenFilePicker' in window){}