0

I am using wicg-file-system-access to access local files for my angular application, it works correctly on localhost but when i deploy changes to dev environment it is not working, i see window.showSaveFilePicker is undefined.

Is there any configuration that required for deployed site?.

1 Answers1

0

Yes, you need a [SecureContext] (https:// or localhost).

[SecureContext] // <-- This means it's only exposed in secure contexts
partial interface Window {
    Promise<sequence<FileSystemFileHandle>> showOpenFilePicker(optional OpenFilePickerOptions options = {});
    Promise<FileSystemFileHandle> showSaveFilePicker(optional SaveFilePickerOptions options = {});
    Promise<FileSystemDirectoryHandle> showDirectoryPicker(optional DirectoryPickerOptions options = {});
};
Kaiido
  • 123,334
  • 13
  • 219
  • 285
  • Thanks, I see that chrome shows "your connection to this site is not secure", i tried with other site it works fine there – Narasing Kokane Mar 09 '23 at 08:22
  • You also have a `globalThis.isSecureContext` property available that let's you check quickly if your current context is secure. – Kaiido Mar 09 '23 at 08:23