new File() constructor appears unimplemented

Issue #9551546 • Assigned to Ali A.

Details

Author
Wladimir P.
Created
Oct 27, 2016
Privacy
This issue is public.
Found in
  • Microsoft Edge
Standard affected
File API

Found in build #
14.14393
Reports
Reported by 10 people

Sign in to watch or report this issue.

Steps to reproduce

  1. Open F12 console and switch to the Console tab.
  2. Enter the code new File(["bar"], "foo.txt", {type: "text/plain"}) and press Enter to run it.

Expected results

A File instance is created.

Actual results

An exception is thrown: “Function expected”

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Brad E.”

    • I encountered this issue today. Any updates?

    • Microsoft Edge Team

      Changed Assigned To from “Brad E.” to “James M.”

      Changed Assigned To to “Venkat K.”

      Changed Assigned To from “Venkat K.” to “Steve B.”

      Changed Assigned To from “Steve B.” to “Ali A.”

      Changed Status to “Confirmed”

    • Has there been any progress on this except being reassigned to a new person every month?

    • Any news?
      The only cheating workaround to mimic its behaviour, for now, is to create a new Blob and append the extension to the filename… It would be useful to have this function available.

      var blob = new Blob([this.response], { type: type });
      if (!document.documentMode && !/Edge/.test(navigator.userAgent)) {
      // THIS KNOWN EDGE BUG
          if (typeof File === "function") {
              blob = new File([blob], filename, { type: type });
          }
      }
      
      if (typeof window.navigator.msSaveBlob !== "undefined") {
      // this workaround
          window.navigator.msSaveBlob(blob, filename + fileExtension);
      }
      
    • We can use blob construct as a file.

      if (/Edge/.test(navigator.userAgent)) {
              blob.lastModifiedDate = new Date();
              blob.name = file.name;
      }``
    • Microsoft Edge Team

      Changed Status from “Confirmed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in